LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 08-24-2006, 06:59 PM   #1
sugar2
Member
 
Registered: Feb 2006
Distribution: Debian 40r0
Posts: 103

Rep: Reputation: 15
cron is not workin well running a custom script on Slackware 10.1...


cron is not workin well running a custom script on Slackware 10.1...


Hi, I tried scheduling this crontab as a roor or as a user called 'cuser'
this is the crontab (without quotes):
'27 15 * * * /home/cuser/custom-scripts/cron-backups.sh>/dev/null 2>&1'

Of course, the shell script has 775 permisions, weirdo thing is that the command can be runned ok from the standar shell, but under cron it just doesnt run... do you think it could be due the use of YYYY-MM-DD_HHMM input switches on the 'rar' program or the '-mtime +365' argument used in find command passed to the cron-backups.sh script?

This is the 'cron-backups.sh' shell script:
Code:
#!/bin/sh
#
find /mnt/usb-storage/MyCompany-SERVER-OM -type f -mtime +365 | xargs rm -f;
rar a -k -rr3%% -dh -m2 -y -pMyPassword -hpMyPassword -tk -o+ -t -ep1 -agYYYY-MM-DD_HHMM /mnt/usb-storage/MyCompany-SERVER-OM/OMBACKUP- /mnt/mounted-nas1/OrderManager;
find /mnt/usb-storage/MyCompany-SERVER-QB -type f -mtime +365 | xargs rm -f;
rar a -k -rr3%% -dh -m2 -y -pMyPassword -hpMyPassword -tk -o+ -t -ep1 -agYYYY-MM-DD_HHMM /mnt/usb-storage/MyCompany-SERVER-QB/QBBACKUP- /mnt/mounted-nas1/Shared/QBook;
cp -f -r -u /mnt/mounted-nas1/. /home/nas2/workware-mirror/;
find /mnt/usb-storage/MyCompany-SERVER-SNAPSHOT -type f -mtime +30 | xargs rm -f;
rar a -k -v1900m -sv- -rr3%% -dh -m1 -y -pMyPassword -hpMyPassword -tk -o+ -ep1 -s -md512 -agYYYY-MM-DD_HHMM /mnt/usb-storage/MyCompany-SERVER-SNAPSHOT/WORKWARE-SNP- /mnt/mounted-nas1;
find /mnt/usb-storage/POS-SERVER-MAINTENANCE -type f -mtime +90 | xargs rm -f
thanks in advance.

Last edited by sugar2; 08-24-2006 at 07:01 PM.
 
Old 08-24-2006, 08:09 PM   #2
jailbait
Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Wheezy, Debian Jessie
Posts: 7,592

Rep: Reputation: 188Reputation: 188
"weirdo thing is that the command can be runned ok from the standar shell, but under cron it just doesnt run"

cron has a much shorter PATH than root or user. Try using the full pathname for each of the commands that you execute.

---------------------
Steve Stites
 
Old 08-24-2006, 08:20 PM   #3
sugar2
Member
 
Registered: Feb 2006
Distribution: Debian 40r0
Posts: 103

Original Poster
Rep: Reputation: 15
I call the shell script for cron using the full path: '/home/cuser/custom-scripts/cron-backups.sh'
i will try... bue i will try using full paths in the shell script too...
i will post results here
 
Old 08-24-2006, 08:41 PM   #4
sugar2
Member
 
Registered: Feb 2006
Distribution: Debian 40r0
Posts: 103

Original Poster
Rep: Reputation: 15
It works now!
I just added the full path for each command used in the script... thanks jailbait!!
 
  


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
cron NOT running php script ??!! hendrixx Programming 1 01-19-2005 06:36 AM
script not running as a cron job sanjith11 Programming 5 11-23-2004 09:42 AM
cron error when running script? meeble Linux - Software 3 09-09-2004 06:00 PM
running a 'dcop' script from 'cron' dsunger Linux - Software 0 05-10-2004 02:17 AM
script not running correctly off cron wedgeworth Linux - Software 3 10-14-2003 09:30 AM


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

Main Menu
Advertisement
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