Crontab No such file or directory


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Crontab No such file or directory
# 1  
Old 10-15-2015
Crontab No such file or directory

I keep getting the crontab No such file or directory error message.

Code:
0,30,31,32,33,34,35,36,37,38,39,40 * * * * "/bin/ps aux --sort -\%mem >> /home/m/bob/cookies"

I have made sure my directory exists.

Code:
find /home/m/bob -iname 'cookies' 2>/dev/null
/home/m/bob/cookies

I am using the full path with ps.

I have backslashed the % sign. I don't know what else to do.
# 2  
Old 10-16-2015
Unless:
Code:
/bin/ps aux --sort -\%mem >> /home/m/bob/cookies

is the name of a file that you want cron to execute for you, remove the double quotes.
# 3  
Old 10-16-2015
Putting it in quotes tells it to look for the file named ps aux --sort -\%mem >> /home/m/bob/cookies inside /bin/ Smilie
# 4  
Old 10-17-2015
It worked Smilie.

Code:
0,15,16,17,18,19,20,30 * * * * /bin/ps aux --sort -\%mem | head >> /home/m/bob/cookies

This User Gave Thanks to cokedude For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to find and get a file in an entire directory with an excluded directory specified?

How to get a file 'zlib.h' in an entire directory with an excluded directory specified lives under that starting directory by using find command, as it failed on: $ find . -name 'zlib.h' -a -ipath 'CHROME.TMP' -prune -o -print it'll just list entirely up (2 Replies)
Discussion started by: abdulbadii
2 Replies

2. Shell Programming and Scripting

Shell script cannot create directory and move the file to that directory

I have a script, which is checking if file exists and move it to another directory if then mkdir -p ${LOCL_FILES_DIR}/cool_${Today}/monthly mv report_manual_alloc_rpt_A_I_ASSIGNMENT.${Today}*.csv ${LOCL_FILES_DIR}/cool_${Today}/monthly ... (9 Replies)
Discussion started by: digioleg54
9 Replies

3. Shell Programming and Scripting

Running script in crontab in a specific directory

I am trying to run a script from crontab but the entire script (which is 70+ lines) is written in bash and I need it to run from a certain directory. So when I run it manually I cd to /local/mnt/scr and then type ./reordersc and it works fine. However, I want it to run from the crontab and I... (20 Replies)
Discussion started by: newbie2010
20 Replies

4. Shell Programming and Scripting

Shell scripting-I need a script which should watch a directory for a file with specific directory

I need a script which should watch a directory for a file with specific directory. If it finds a file in directory, it should search for few specific keyword in the file. if the keyword exists, it should trim string from specific column. The file should be moved to another directory and the a... (8 Replies)
Discussion started by: akashdeepak
8 Replies

5. Shell Programming and Scripting

Change to directory and search some file in that directory in single command

I am trying to do the following task : export ENV=aaa export ENV_PATH=$(cd /apps | ls | grep $ENV) However, it's not working. What's the way to change to directory and search some file in that directory in single command Please help. (2 Replies)
Discussion started by: saurau
2 Replies

6. UNIX for Advanced & Expert Users

"No such file or directory" while running crontab

I am trying to take backup of server. while running manually, script working successfully. while running in crontab its showing "/bin/sh: /webMethod6/CustomMonitoring/scripts/backupWebMethodsCodeBase.sh: No such file or directory" code forbackupWebMethodsCodeBase.sh #!/bin/ksh #Purpose... (8 Replies)
Discussion started by: elango963
8 Replies

7. Shell Programming and Scripting

Grepping file names, comparing them to a directory of files, and moving them into a new directory

got it figured out :) (1 Reply)
Discussion started by: sHockz
1 Replies

8. Shell Programming and Scripting

Crontab and working directory

Hi all I would like to crontab some python script I have. These have the task to write a txt file on the same directory where they are let' say 'scriptFolder'. When I schedule the script execution with crontab the file is printed out somewhere else. Is there any way to tell crontab that for... (2 Replies)
Discussion started by: manustone
2 Replies

9. Shell Programming and Scripting

Move a file from windows directory to unix directory

Move a file from windows directory to unix directory, is this possible? if it is, can someone help me on this? Thanks! God bless! (1 Reply)
Discussion started by: kingpeejay
1 Replies

10. UNIX for Dummies Questions & Answers

/bin/sh: /usr/bin/vi: No such file or directory when doing crontab

I just set up an ftp server with Red Hat 5.2. I am doing the work, I'm baby stepping, but it seems like every step I get stuck. Currently, I'm trying to set up a crontab job, but I'm getting the following message: /bin/sh: /usr/bin/vi: No such file or directory. I see that vi exists in /bin/vi,... (3 Replies)
Discussion started by: kwalter
3 Replies
Login or Register to Ask a Question