Hi,
I'm having some problems with a script in /etc/cron.daily. It's quite simple: ------ #!/bin/sh touch /mnt/Backup/foo
rsnapshot daily -----
So the touch gets executed, but the rsnapshot not. If I run manually
run-parts /etc/cron.daily/
everything's fine. Also when I run rsnapshot from roots crontab. So I have no idea what's the issue here.
Any ideas / recommendations what to check?
Andreas
I'm having some problems with a script in /etc/cron.daily. It's quite simple:
#!/bin/sh touch /mnt/Backup/foo
rsnapshot daily
So the touch gets executed, but the rsnapshot not. If I run manually
run-parts /etc/cron.daily/
everything's fine. Also when I run rsnapshot from roots crontab. So I have no idea what's the issue here.
Any ideas / recommendations what to check?
PATHS - everytime i have cron issues its a PATH problem. The cron env is not the same as the user when logged in
PATHS - everytime i have cron issues its a PATH problem. The cron env is not the same as the user when logged in
Thanks, that's probably the cause. rsnapshot resides in /usr/local/bin I changed the PATH in /etc/crontab now. Silly that I didn't see it. So jobs in /etc/crontab are executed with the PATH in there, but jobs in roots crontab are executed with the PATH set in .bashrc?
Andreas
Andreas Kuntzagk wrote:
PATHS - everytime i have cron issues its a PATH problem. The cron env is not the same as the user when logged in
Thanks, that's probably the cause. rsnapshot resides in /usr/local/bin I changed the PATH in /etc/crontab now. Silly that I didn't see it. So jobs in /etc/crontab are executed with the PATH in there, but jobs in roots crontab are executed with the PATH set in .bashrc?
Andreas
You can prove to yourself quite easily that $PATH gets manipulated. Simply make a crontab entry like this in root's crontab:
* * * * * echo $PATH >> /root/cronpath
and compare the entries in the resulting file with the command line output of # echo $PATH
(Don't forget to remove that crontab entry when finished playing.)