Home
Man
Search
Today's Posts
Register

BSD, Linux, and UNIX shell scripting Post awk, bash, csh, ksh, perl, php, python, sed, sh, shell scripts, and other shell scripting languages questions here.

Script not working in cron but working fine manually

Tags
cron, cron job, crontab, shell script, shell scripts

Login to Reply

 
Thread Tools Search this Thread
# 1  
Old 07-05-2012
Script not working in cron but working fine manually

Help. My script is working fine when executed manually but the cron seems not to catch up the command when registered.

The script is as follow:
Code:
#!/bin/sh 

for file in file_1.txt file_2.txt file_3.txt
do
    awk '{ print "0" }' $file > tmp.tmp
    mv tmp.tmp $file
done


And the cron job I am making is:
Code:
*/2 * * * * /root/folder/test.sh

Thanks for the help.

Last edited by Franklin52; 07-05-2012 at 08:29 AM.. Reason: Please use code tags for data and code samples, thank you
# 2  
Old 07-05-2012
provide the absolute path of file_1.txt... file_2.txt...

Code:
 
for file in file_1.txt file_2.txt file_3.txt

# 3  
Old 07-05-2012
thanks a lot. It works!
Login to Reply

« Previous Thread | Next Thread »
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Automating pbrun /bin/su not working, whenever manually it is working using putty jorgejac Shell Programming and Scripting 14 12-03-2015 02:32 PM
sed command not working inside ksh script but works fine outside vital_parsley Shell Programming and Scripting 8 10-07-2013 09:58 AM
Getting Command not found error Even though Script is working fine harpal singh Shell Programming and Scripting 3 01-11-2013 04:41 AM
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
Script working when run manually but not in crontab showing path not found raj_saini20 Shell Programming and Scripting 3 07-17-2012 06:47 AM
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 runs fine manually but not in crontab umarsatti Shell Programming and Scripting 16 05-29-2012 08:12 AM
Sed script not working properly on Solaris (works fine on AIX)? Faith111 Shell Programming and Scripting 7 03-01-2012 05:09 AM
Getting issue while running it from cron while manually working fine anuragpgtgerman Shell Programming and Scripting 1 01-23-2012 03:06 PM
Script is not working from cron while working manually anuragpgtgerman Shell Programming and Scripting 3 01-23-2012 02:54 PM
Shell script not working in cron malikp Shell Programming and Scripting 4 01-22-2010 11:00 AM
GUI not working... CLI is working fine bharu_sri Solaris 4 12-23-2008 12:35 AM
How to know whether my perodic thread is working fine rajamohan UNIX for Advanced & Expert Users 1 10-29-2008 05:51 PM
NAWK Script not working fine dheeraj19584 Shell Programming and Scripting 3 06-12-2008 08:36 AM
script not working in CRON abhijeetkul Shell Programming and Scripting 5 07-13-2006 06:48 AM


All times are GMT -4. The time now is 07:59 AM.

Unix & Linux Forums Content Copyright 1993-2018. All Rights Reserved.
UNIX.COM Login
Username:
Password:  
Show Password