![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Script through cron and command line | rahulrathod | UNIX for Dummies Questions & Answers | 3 | 02-22-2008 07:10 AM |
| works step by step on command line but not in script | whamchaxed | Shell Programming and Scripting | 2 | 12-06-2007 07:47 AM |
| script works on command line, not in cron job | JackTheTripper | UNIX for Dummies Questions & Answers | 7 | 06-27-2007 02:51 AM |
| Script works fine until I | more | Skovian | Shell Programming and Scripting | 2 | 01-11-2006 11:17 AM |
| Adding command line env in cron env | abhijeetkul | Shell Programming and Scripting | 1 | 12-13-2005 09:42 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Cron job fails, but works fine from command line
I have a very basic script that essentially sends a log file, via FTP, to a backup server. My cron entry to run this every night is:
55 23 * * * /usr/bin/archive_logs The script runs perfectly when executed manually, and actually worked via cron for about three weeks. However, it mysteriously stopped working. I removed the entry from cron, re-added it. I even changed the time in the cron entry and tried it again. It still won't run from cron, but, again, works like a champ when I run it manually. Below is the script: ==================================================== #!/bin/sh DAY=`date +%m%d%y` #Copy log to /tmp and add timestamp cp /archive/logs/sys/alarm.log /tmp/alarm.log.$DAY #Send file to webservers cd /tmp ftp -n 123.45.678.90 << ! user xxxxxxxx yyyyyyyy! cd Developers/VMSMSP/Archive/MSP/MSPWASH put alarm.log.$DAY ! #Cleanup cd /tmp rm alarm.log.$DAY ======================================================= Any ideas? |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|