LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Cron Problems (https://www.linuxquestions.org/questions/linux-newbie-8/cron-problems-342423/)

DNAphil 07-12-2005 07:17 AM

Cron Problems
 
Hello,

I am a relative n00b when it comes to Linux, so I hope that I give you the right information.

I have built a backup server using Fedora Core 4, and have it backing up a Linux Fedora Core 2 machine, and my Windows XP machine.

For the FC2 machine, I have set up NSF and am able to mount the drives using mount.

For the XP machine, I used mount.cifs and am able to mount the drives.

I wrote a backup script which mounted the XP directories, three in total, using mount.cifs. It then uses a perl script to backup the three directories onto the backup server. It then umounts the three directories, and mails me the log from the perl script.

When I tested the script, I logged in as root, ran the script with the command:
/bin/sh < backup_sys.cron

When I do this, the script runs fine and all the backups are completed.

I then put it into Crontab to run nightly at 2:30am. I used the exact same command above, in the Crontab entry.

When Cron runs the script it is unable to mount the XP drives. The email message from Cron, says that mount.cifs command not found. The message says it is logged in as root, but it cannot find the mount.cifs command.

I have checked the script and all directory names are full, there are no relative paths and such for any of the backup or destination directories, so the script should work if run from any directory.

The mount.cifs command I am using is:
mount.cifs //Machine Name/ share name mount-point -o password=
(there is no password for the XP directories)

So what is causing mount.cifs not to work, when cron runs the script compared to when I log in as root and run it?

Any help will be appreciated.

Nathanael 07-12-2005 07:56 AM

the problem lies not within the mount.cifs
but with finding mount.cifs
try puting the full path to mount.cifs in your crontab
eg:
Code:

* * * * * /path/to/mount.cifs


All times are GMT -5. The time now is 08:08 PM.