Sunday, May 5, 2024
6
rated 0 times [  6] [ 0]  / answers: 1 / hits: 1392  / 1 Year ago, mon, may 15, 2023, 11:11:04

I am writing a sh file to take screen short and want to schedule in crontab
but when i run the .sh file it run OK no problem happens but when try to schedule it in crontab i got an error like



import: unable to open X server `' @ error/import.c/ImportImageCommand/366.


my .sh file is like



#!/bin/bash
filename='ABC'
import -window root $HOME/Desktop/$filename.png


any idea how to solve it i tried with



which import


it is showing



/usr/bin/

More From » command-line

 Answers
2

You could probably add this line before the import line



export DISPLAY=':0'

[#26939] Tuesday, May 16, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
atereress

Total Points: 79
Total Questions: 106
Total Answers: 119

Location: Federated States of Micronesia
Member since Sun, May 16, 2021
3 Years ago
atereress questions
Wed, Aug 4, 21, 03:15, 3 Years ago
Sat, Apr 16, 22, 17:34, 2 Years ago
Thu, Dec 22, 22, 05:56, 1 Year ago
Sun, May 15, 22, 15:59, 2 Years ago
;