Find the answer to your Linux question:
Results 1 to 3 of 3
My root Vixie cron crontab is set to perform a system snapshot via fsarchiver: 0 0 * * * fsarchiver savefs -o -A /backups/p30_root.fsa /dev/sda2 /dev/sda3 The command itself works ...
  1. #1
    Just Joined!
    Join Date
    Jun 2010
    Posts
    2

    Cron & fsarchiver reportedly running, not actually running?

    My root Vixie cron crontab is set to perform a system snapshot via fsarchiver:

    0 0 * * * fsarchiver savefs -o -A /backups/p30_root.fsa /dev/sda2 /dev/sda3

    The command itself works fine, generating about a 7G snapshot of my Suse server.

    I then wish to rsync this to a NAS I have located in another building:

    0 3 * * * rsync -av -e ssh --delete /backups/ root{at address}:/DataVolume/os_backups/

    (yes, I'm rsyncing as root. I absolutely loathe it, but I got thrown into an quasi-SA position with a ridiculous to-do list and no time to do it. I'm having to make things just work and then go back and try to improve them/learn how. I couldn't make it work in a non-root way quick enough, so for now I'm having to cron rsync jobs as root because of all the differing file permissions on this samba/MySql server. I set the NAS to only accepts ssh from the server IP, and we're behind a campus firewall... hopefully that'll help some in the meantime. It's serious trial by fire.)

    The crontab also has rsync commands for the samba areas, our specialized chemistry software and affiliated MySQL databases.

    /var/log/messages reports that each line of the crontab has run, and I have my etc/rsyslog.conf set to give me debug level messages in the var/log/messages (I think):
    *.debug;mail.none;news.none -/var/log/messages;RSYSLOG_TraditionalFileFormat

    The rsync commands for files and structures run fine, BUT the fsarchiver command never seems to run (snapshot is still an old one), nor does the rsync command for the fsarchiver snapshot:

    0 3 * * * rsync -av -e ssh --delete /backups/ root{at address}:/DataVolume/os_backups/

    These commands work fine when I issue the same one from the command line, /var/log/messages reports that they've run:

    Jun 1 00:00:01 {machinename} /usr/sbin/cron[24578]: (root) CMD (fsarchiver savefs -o -A /backups/p30_root.fsa /dev/sda2 /dev/sda3)

    But the snapshot is from May 25th, the last time I manually ran the command.

    I'm at a loss. This seems like it should be a relatively simple thing. Why wouldn't this command be run?

    Any input is greatly appreciated. Thanks!

  2. #2
    Linux Guru
    Join Date
    Nov 2007
    Posts
    1,695
    Cron 101: Google: cron user environment

    As you have already noted, cron *IS* trying to run the command. If the binary is not found, nothing happens. If you want to know more about your command, you need to write a better script for cron to execute that provides feedback. It is good practice to put the full path to the binary IN the cron command.

    Code:
    0 0 * * * /usr/sbin/ntpdate pool.ntp.org
    Don't leave it up to the path variable to find your binary or else you need to ensure the user environment is correct.

    Google: why isn't cron running my command

  3. #3
    Just Joined!
    Join Date
    Jun 2010
    Posts
    2
    That would definitely explain it

    Thank you very much for your help!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...