Forums

Rein
Rein
Offline
Resolved
0 votes
Hi,

I placed the file:backup-dwt in /etc/cron.d
It says:
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# dagelijks om 22:43 uitvoeren van de zarafa bu
37 22 * * * root /root/zarafa_db_bu.sh
# dagelijks om 00:12 12:12 en 18:12 uitvoeren van de rsync_bu (flexshare, home en zarafa attachments - incremental)
17 00,12,18 * * * root /root/rsync_bu.sh

I restarted the crond deamon with:
service crond restart


Why aren't both files triggered? What is it I'm doing wrong?
When I start the jobs they are working fine.
permissions: 755, owner: root, group: backup_operators
Friday, January 02 2015, 01:45 PM
Share this post:
Responses (5)
  • Accepted Answer

    Rein
    Rein
    Offline
    Saturday, January 03 2015, 11:24 AM - #Permalink
    Resolved
    0 votes
    OK, thanks. It is solved!

    The only problem was: No Enter (new line) after the last line in the file:backup-dwt
    17 00,12,18 * * * root /root/rsync_bu.sh

    The job /root/zarafa_db_bu.sh did run. I just overlooked it in /var/log/cron :blush:

    Thanks for the help,
    The reply is currently minimized Show
  • Accepted Answer

    Saturday, January 03 2015, 10:22 AM - #Permalink
    Resolved
    0 votes
    I meant the full paths in your rsync_bu.sh script.
    The reply is currently minimized Show
  • Accepted Answer

    Rein
    Rein
    Offline
    Saturday, January 03 2015, 09:59 AM - #Permalink
    Resolved
    0 votes
    Thanks for your thougts.

    Yes I checked /var/log/cron
    Because the scripts write (echo ) a start and stop message to the log.
    I see the START/STOP msg only when I start the jobs by hand.

    @Nick I do mention the full path? /root/rsync_bu.sh what else to specify.
    I'll try the shell variant mentioned by Tony.
    The reply is currently minimized Show
  • Accepted Answer

    Friday, January 02 2015, 11:37 PM - #Permalink
    Resolved
    0 votes
    or something like this

    37 22 * * * /bin/su root -l -c "/root/zarafa_db_bu.sh"

    did you check /var/log/cron ?
    The reply is currently minimized Show
  • Accepted Answer

    Friday, January 02 2015, 07:49 PM - #Permalink
    Resolved
    0 votes
    When you run your cron job you are executing your scripts with root permissions, but I don't think they run with root's environment. you may need to specify full paths to executables or set PATH in your shell script.
    The reply is currently minimized Show
Your Reply