Scripts exists but crontab says "File not found"

Thread Tools Search this Thread
# 1  
Scripts exists but crontab says "File not found"

Hi All,

We have an archiving script on our applications box. It is scheduled to run at 36th minute every hour.

36 * * * * /

But it throws an error saying "sh: / not found". I am not able to understand why.

# ls -l / ; file /
-rwxr-xr-x   1 root     root          74 Apr 19 09:44 /
/  executable /sbin/bash script

Can anyone enlighten me why?
# 2  
try with

36 * * * * bash /

# 3  
Hi Raj,

1.How does the system know this is a bash script? From the first line of the file?
# head -1 /

2. If my working shell is Bourne, can I make the cron-job work without editing it all
#  echo $0 ; head -1 /

Last edited by satish51392111; 07-18-2012 at 10:24 AM..
# 4  
What do you get for:
type /sbin/bash
type /bin/bash
type /usr/bin/bash

# 5  
# type /sbin/bash ; type /bin/bash ; type /usr/bin/bash
/sbin/bash not found
/bin/bash is /bin/bash
/usr/bin/bash is /usr/bin/bash

By the way, this did not work:
36 * * * * bash /

i am still getting the error "sh: / not found"
But, when I run
# sh /

it works and does not show any error. :-s

---------- Post updated at 10:51 AM ---------- Previous update was at 08:47 AM ----------


It is now resolved after trail and error:
The script type is bash and the first line in the script read till then "#!/sbin/bash" which did not exist in the box. So, I changed that to "#!/bin/bash" which is tha path to bash shell in the box and now the job is running sucessfully.
AKA : As shown in the error message, it was not the script-file that was not found.. It was the shell that was not found
This made my day!

Posted this just in case someone might get the same error.


Moderator's Comments:
Mod Comment Thank you for posting the solution. The location of bash was what I suspected.

Last edited by methyl; 07-18-2012 at 07:06 PM..

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

2. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

3. Shell Programming and Scripting

Delete till ">" is found in all lines in a file

Hi, I have a file which has lines like these : I want to trim everything from the left till ">" such that the file looks like : If you have any ideas how to do this in 1-2 commands please help. Thanks. (3 Replies)
Discussion started by: sinpeak
3 Replies

4. Red Hat

Could interrupt disabled cause "opreport error: No sample file found"?

Hi All I would like to profile my application with oprofile but I can't since no samples are collected. The kernel of my app is 2.6 on RED HAT Enterprise 5.3 (Tikanga) so OProfile is setup in timer interrupt mode # opcontrol --list-events Using timer interrupt. I... (0 Replies)
Discussion started by: manustone
0 Replies

5. Ubuntu

Ubuntu Server 10.04 LTS - Regular crontab "caches old scripts"

Hi, I'm using a Ubuntu Server 10.04 LTS and it works like a charm, except for the regular crontab. Onde day a user had some problems with crontab, i analyse it and i see no problemns, all my stuff is working right. Cron is running smoth... I only noticed it when i altered a script already... (2 Replies)
Discussion started by: grafman
2 Replies

6. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

7. Shell Programming and Scripting

list all scripts in crontab which contains the string "sqlplus"

Hi folks I use a Solaris 10 box with Bash shell. I have here a script (it works!) to list all scripts in crontab which contains the string "sqlplus": for i in $(ls `crontab -l | grep -v '#' | awk '{ print $6 }' | grep -v '^$'`); do grep -l 'sqlplus' "$i"; done Is there a more elegant... (1 Reply)
Discussion started by: slashdotweenie
1 Replies

8. UNIX for Advanced & Expert Users

kernel debug:"Symbol file not found for *.ko"

When I debug vmlinux with gdb, after it connect to the target, I got below output: usbcore.ko: No such file or directory. Error while mapping shared library sections: ohci_hcd.ko: No such file or directory. Symbol file not found for usbcore.ko Symbol file not found for ohci_hcd.ko Symbol... (2 Replies)
Discussion started by: yanglei_fage
2 Replies

9. UNIX for Dummies Questions & Answers

Does "gzip" have a no prompt option on it for overwriting if file exists?

So I dont enounter things like: gzip: /sometimename.gz already exists; do you wish to overwrite (y or n)? Want to add it into a script and if there is a file aready there to just overwrite it, otherwise the script will hang unless there is manual intervention. (1 Reply)
Discussion started by: LordJezo
1 Replies

Featured Tech Videos