Script runs fine, but not in a cron

shell scripts

Login to Reply

Thread Tools Search this Thread
# 1  
Old 01-23-2010
Script runs fine, but not in a cron

Okay, I have the following script that runs fine from a command line as well as an executable .sh file. It just moves any file/folder with movie* in the name to a folder called _Movies. The issue I'm running into is when it's call from a cron.

find /mnt/HD_a2/BT/complete -iname "movie.*" -exec mv {} /mnt/HD_a2/BT/complete/_Movies \;

Crontab looks like the following, with my scripts being called

32 2 * * * /usr/sbin/rtc -s
30 2 2 * * /usr/sbin/rtc -c
59 1 * * * /usr/sbin/daylight &
*/10 * * * * /usr/sbin/offl_chk two &
*/60 * * * * /usr/sbin/getdhcp&
* * * * * /ffp/sbin/ >> /mnt/HD_a2/move_downloads.log 2>&1

I realize it's running every minute, but it's set that way while I debug it. I get the following in the log file, and the movie does not move when the cron job is ran.

BusyBox v1.00-pre1 (2008.09.02-11:43+0000) multi-call binary

Usage: find [PATH...] [EXPRESSION]

Any ideas? I'm going crazy trying to figure out what could be wrong. Thanks!
# 2  
Old 01-23-2010

when you remove the

part it will work. I think the answer is hidden in this link that i saw a few days ago here :
# 3  
Old 01-23-2010
I just tried that, but it still doesn't seem to work. I get the same results, but now with an empty log file.
# 4  
Old 01-24-2010
Any ideas? I'm going crazy trying to figure out what could be wrong. Thanks!
Yeah. I think the problem is that you are using the find that comes with busybox (located in /bin), and not the find that comes with ffp (located at /ffp/bin/find). Try simply to export the path to /ffp in your script and your cron should work as expected:
 export PATH=/ffp/sbin:/ffp/bin:$PATH

By the way do you know this forum: DSM-G600, DNS-323 and TS-I300 Hack Forum? This would be a good place to raise such issue.


Last edited by Loic Domaigne; 01-24-2010 at 04:28 PM.. Reason: grammar
# 5  
Old 01-24-2010
Thanks! That was the issue. I appreciate you help.
Login to Reply

Thread Tools Search this Thread
Search this Thread:
Advanced Search

Similar Threads More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Script runs manually, but not from cron bredman Shell Programming and Scripting 11 05-28-2016 03:06 AM
Script runs in command-line fine but times out in CRON? phpchick Shell Programming and Scripting 4 05-31-2013 04:22 PM
Odd results when my script runs from cron.. Marc G Shell Programming and Scripting 11 02-27-2013 12:01 PM
Script runs in shell but not cron herot AIX 2 12-31-2012 08:18 PM
Part of the Shell script is not running via crontab, runs fine manually gowthamakanthan Shell Programming and Scripting 18 10-04-2012 04:41 PM
Shell script not getting called through cron job but executes fine manually. Dejavu20 Shell Programming and Scripting 17 07-05-2012 03:43 PM
Script not working in cron but working fine manually jasperux Shell Programming and Scripting 2 07-05-2012 01:37 AM
Script runs fine manually but not in crontab umarsatti Shell Programming and Scripting 16 05-29-2012 08:12 AM
Shell Script runs good manually but not through Cron tab naren.chowdhary Shell Programming and Scripting 1 05-14-2012 02:02 PM
CRON shell script only runs correctly on command line louieaw Shell Programming and Scripting 4 04-06-2011 05:21 AM
Shell script runs fine in Solaris, in Linux hangs at wait command aksaravanan Shell Programming and Scripting 13 11-01-2010 11:40 AM
getting Segmentation Fault (core dumped) error but Program runs fine. bhavesh.sapra Programming 4 10-22-2010 08:39 AM
awk command in script gives error while same awk command at prompt runs fine: Why? catalys Shell Programming and Scripting 4 09-20-2010 11:07 PM
Script Runs fine but not giving any output jagadish_gaddam Shell Programming and Scripting 7 03-29-2010 11:19 PM
Script runs fine on UNIX Server...Not through MSK Tool kit on Windows Server madhunk UNIX for Dummies Questions & Answers 5 01-31-2008 01:30 PM
All times are GMT -4. The time now is 03:59 AM.

Unix & Linux Forums Content Copyright 1993-2018. All Rights Reserved.
Show Password

Not a Forum Member?
Forgot Password?