Development > Scripting and Bash

Cron job to automate backup????

<< < (2/3) > >>

Wirezfree:
@firenice03
great minds, well hopefully great minds....

Wirezfree:
I'm just stabbing in the dark....
Grsync is a GUI version of rsync..
Maybe that is the Gtk-WARNING cannot open display
Maybe it's trying to output something GUI-wise but it is not running a gui..??
I'm probably not making sense...

Can you not try just rsync..??

firenice03:

--- Quote ---(grsync:11062): Gtk-WARNING **: cannot open display: :0.0
--- End quote ---
Looks like its trying to launch a GUI of sorts..???..??
http://askubuntu.com/questions/614387/gksu-gtk-warning-cannot-open-display-0

Another thought.. isn't CRON (sh) shell based and terminal is BASH... Not sure if this is still the case/true...
But the script runs in terminal and fails in cron - I assume it fails from any shell window...

Maybe its trying to prompt for roots PW??
Something like.. http://stackoverflow.com/questions/22704290/linux-cron-job-fails-to-execute-part-of-script-which-works-in-shell

Hope it helps point in the right direction...

kjacobs:
Thanks for the tip.....that at least got some info on what is going on......got this from the mail file:



Subject: Cron <root@kenneth-OptiPlex-755> DISPLAY=:0.0 /home/kenneth/bin/backup.sh # JOB_ID_3
Content-Type: text/plain; charset=ANSI_X3.4-1968
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=root>
Message-Id: <20151214165201.DA4455E165B@kenneth-OptiPlex-755>
Date: Mon, 14 Dec 2015 08:52:01 -0800 (PST)


No protocol specified


(grsync:11062): Gtk-WARNING **: cannot open display: :0.0


Not sure what this means....LOL. Also tried it without the DISPLAY command......still did not start.



Subject: Cron <root@kenneth-OptiPlex-755> /home/kenneth/bin/backup.sh >/home/kenneth/bin/text.txt # JOB_ID_3
Content-Type: text/plain; charset=ANSI_X3.4-1968
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=root>
Message-Id: <20151214164801.BDA305E165B@kenneth-OptiPlex-755>
Date: Mon, 14 Dec 2015 08:48:01 -0800 (PST)




(grsync:10646): Gtk-WARNING **: cannot open display:

Wirezfree:
Does any of this help:
http://askubuntu.com/questions/222512/cron-info-no-mta-installed-discarding-output-error-in-the-syslog

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version