![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| AIX and cron logs filtering ?: /etc/cronlog.conf, /var/adm/cron/log | Keith Johnson | AIX | 0 | 01-09-2008 05:32 PM |
| Script doesn't work, but commands inside work | cheongww | UNIX for Dummies Questions & Answers | 2 | 11-14-2006 07:52 PM |
| Command doesn't work under cron ? | bigjohn-nj | Shell Programming and Scripting | 4 | 01-20-2006 01:38 PM |
| script didn;t work in cron !!! @_@ | stancwong | Shell Programming and Scripting | 2 | 10-04-2005 06:25 AM |
| ncopy doesn't work from cron | Selma | UNIX for Dummies Questions & Answers | 2 | 01-20-2005 06:28 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Simple cron job won't work
I have a script in a directory -say users/me/test/
It looks like this: # "bkup" - copies specified files to the user's ~/Backup # directory after checking for name conflicts. a=$(date +%T) cp $1 ~/test/Backup/$1.$a It copies file.txt from current directory and timestamps the name of it of it. No problem there. bkup runs ok I have a cron job that looks like this: 54 18 * * * /`users/me/test/bkup I do crontab cron.txt and get no error I set it up to run in the next few minutes. When the appointed time comes, instead of getting a new file copied, i get a mail from the Unix saying Your "cron" job on thebox /users/calcdev/coregan/pocbatch/bkup produced the following output: sh: /users/me/test/bkup^M: not found What incredibly simple thing am I doing wrong? Do I have permissions to run the job. Seems like it can't find the script to run it. |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
dont edit your crontab file w/ a windows editor.
remove the ^M at the end of your crontab entrie. |
|
#3
|
||||
|
||||
|
|
|
#4
|
|||
|
|||
|
^M chars should be the cause.
You can remove them by opening the file in vi editor and using the foll command in the command mode: %s/ctrl-v ctrl-m//g (finally, it should show :%s/^M//g) |
|
#5
|
|||
|
|||
|
^M was the carriage return as described previously thanks to everyone.
I was editing it in UltraEdit because I can never get to grips with vi editor - I know that's blasphemy! - but UltraEdit is so much easier to use. Apart from when there are carriage returns in there of course! |
|||
| Google The UNIX and Linux Forums |