Startup from script
I have this issue with running commands from a script: In my crontab I define script 'do_daily.run': 30 23 * * * root /root/cronjobs/do_daily.run The content of this script (amongst others) is: rsync -avpog /etc /backup/$DATE/ Funny thing now is that in the output of the script, the following appears: /root/cronjobs/do_daily.run: rsync: not found file credentials of the script itself: -rwx-- 1 root wheel 246 Jun 20 2010 do_daily.run What do I oversee here? kind regards, Jos Chrispijn ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Startup from script
On Tue, 22 May 2012 13:50:10 +0200 Jos Chrispijn wrote: I have this issue with running commands from a script: In my crontab I define script 'do_daily.run': 30 23 * * * root /root/cronjobs/do_daily.run The content of this script (amongst others) is: rsync -avpog /etc /backup/$DATE/ Funny thing now is that in the output of the script, the following appears: /root/cronjobs/do_daily.run: rsync: not found file credentials of the script itself: -rwx-- 1 root wheel 246 Jun 20 2010 do_daily.run You need to set PATH in the crontab or script, or use the full path for rsync. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Startup from script
Jos Chrispijn writes: The content of this script (amongst others) is: rsync -avpog /etc /backup/$DATE/ Funny thing now is that in the output of the script, the following appears: /root/cronjobs/do_daily.run: rsync: not found file credentials of the script itself: -rwx-- 1 root wheel 246 Jun 20 2010 do_daily.run 1) rsync is a port. 2) by default, ports install executables to /usr/local/bin 3) by default, do_daily_run will inherit its environment - including PATH - from crontab(5) (system or per-user). 4) by default, the crontab PATH does not include /usr/local/bin. (There is a reason for this.) Recommended solution: provide the full path to rsync. Robert Huff ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Startup from script
In my crontab I define script 'do_daily.run': 30 23 * * * root /root/cronjobs/do_daily.run The content of this script (amongst others) is: rsync -avpog /etc /backup/$DATE/ Funny thing now is that in the output of the script, the following appears: /root/cronjobs/do_daily.run: rsync: not found file credentials of the script itself: -rwx-- 1 root wheel 246 Jun 20 2010 do_daily.run What do I oversee here? add PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin in the beginning of your crontab your default $PATH is NOT cron default $PATH ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Startup from script
Thank you (all) for your information; I followed your suggestions and it all works flawless! best regards, Jos Chrispijn ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org