LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 03-25-2009, 08:00 AM   #1
rastellig
LQ Newbie
 
Registered: Jan 2009
Posts: 8

Rep: Reputation: 0
Script won't run in crontab


Hi all,
I say you in advance that I'm linux newbie

I've to run a simple script in a crontab job : this work via shell but won't start via crontab job (it seems that doesn't start). I've tried to make a log (adding a > /home/errlog.log) but this is empty.

OS = ubuntu server 8.10

Here's my script sync_vm.sh
---------------------------------
cd /usr/bin/
./vmware-mount /var/lib/vmware/Virtual\ Machines/server/server.vmdk /mnt/server/
mount.cifs //server/c$ /mnt/sv_c ro -o username=user%pwd
rsync -a -v --delete /mnt/sv_c/Inetpub/wwwroot/folder /mnt/server/Inetpub/wwwroot/
umount.cifs /mnt/sv_c
./vmware-mount -d /mnt/server/
----------------------------------

My script is in /root/ folder
I've added a line in crontab -e
0 13 * * * /root/sync_vm.sh > /dev/null

Anyone of you could you help me to find issue...?

In other forum someone says to use absolute path in crontab call
So I change it in
0 13 * * * /bin/sh /root/sync_vm.sh > /dev/null
But nothing change

Someone say me that crontab environment run separately from user shell environment

I become crazy....

Is there others way to run this script ??????

Thanks to all
 
Old 03-25-2009, 08:27 AM   #2
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Linux Mint
Posts: 8,511

Rep: Reputation: 884Reputation: 884Reputation: 884Reputation: 884Reputation: 884Reputation: 884Reputation: 884
you need to use absolute path in the script
rsync => /usr/bin/rsync
idem for other commands
also, you should recieve a email from cron with the error messages
 
Old 03-25-2009, 09:18 AM   #3
rastellig
LQ Newbie
 
Registered: Jan 2009
Posts: 8

Original Poster
Rep: Reputation: 0
yesssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss

:-) :-) :-) :-) :-) :-) :-) :-) :-) :-) :-) :-) :-) :-) :-) :-)

Many many thanks
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to run this script in Crontab baig Linux - Newbie 2 11-30-2008 02:34 PM
how to run crontab in shell script panselva Linux - General 3 05-08-2008 08:33 PM
script won't run in crontab(centos 5) ncsuapex Programming 2 03-09-2008 06:55 PM
Crontab -e doesnt run my script ! c0nsur Linux - General 4 08-03-2005 11:21 PM
Script doesn't run in crontab dani81 Linux - General 1 11-16-2004 03:42 AM


All times are GMT -5. The time now is 02:05 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration