Solved cron [troubleshooting]

# /etc/crontab - root's crontab for FreeBSD
#
# $FreeBSD$
#
SHELL=/bin/sh
PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
#
#minute hour mday month wday who command
#
*/5 * * * * root /usr/libexec/atrun
15 * * * * root /usr/local/bin/rsync -a /usr/home/hack /mnt/bak

Feb 23 15:10:28 astro crontab[3208]: (root) BEGIN EDIT (root)
Feb 23 15:10:39 astro crontab[3208]: (root) REPLACE (root)
Feb 23 15:10:40 astro crontab[3208]: (root) END EDIT (root)
Feb 23 15:11:00 astro /usr/sbin/cron[927]: (root) RELOAD (tabs/root)
Feb 23 15:11:00 astro /usr/sbin/cron[3397]: (operator) CMD (/usr/libexec/save-entropy)
Feb 23 15:15:00 astro /usr/sbin/cron[4844]: (root) CMD (/usr/libexec/atrun)
Feb 23 15:15:00 astro /usr/sbin/cron[4847]: (root) CMD (root^I/usr/libexec/atrun)
Feb 23 15:15:00 astro /usr/sbin/cron[4846]: (root) CMD (root ^I/usr/local/bin/rsync -a /usr/home/hack /mnt/bak )
Feb 23 15:20:00 astro /usr/sbin/cron[6610]: (root) CMD (/usr/libexec/atrun)
Feb 23 15:20:00 astro /usr/sbin/cron[6611]: (root) CMD (root^I/usr/libexec/atrun)

Seems like cron does not rsync. No files from /usr/home/hack are copied to /mnt/bak.
I'm on FreeBSD 12 STABLE.

Update: when running the cron as user and not as root rsync executes.
 
Back
Top