![]() |
|
|
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 |
| Problem with csh script | rahulrathod | Shell Programming and Scripting | 4 | 02-21-2008 12:38 PM |
| script problem | tdavenpo | Shell Programming and Scripting | 3 | 01-04-2006 04:07 PM |
| Problem starting a script from a 'main'-script | Rakker | UNIX for Dummies Questions & Answers | 3 | 06-28-2005 09:12 AM |
| problem with a script | Lestat | Shell Programming and Scripting | 4 | 06-13-2005 01:30 PM |
| problem with ftp script...please help | vancouver_joe | UNIX for Advanced & Expert Users | 2 | 11-22-2001 07:47 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
FTP Script Problem
Hi, Firstly, I would like to admit that I am a scripting newb. Now, to my question: I am writing a script that FTPs a bunch of logs from one server to another, it will be scheduled in Cron to run every 20 minutes. Currently, the file transfer part of the script is fine. However, when the logs are transferred from server A to B, I want to delete the copies on server A, but I am unable to get the return code. Here is my script so far: Code:
# # 22-11-2005 # John # T&A Website # # Automates the FTP transfer of logs from A to B. # cd /x/logs/TAWEB ftp -nv star-d << ! quote USER test quote PASS testpass cd /x/logs/TAWEB mput * if [[ $? ]]; then echo FTP_OK! rm DAILY* rm STATS* else echo FTP_FAIL! fi quit ! However, I am getting the error: Code:
.... ?Invalid command .... multiple times (once for each log that exists). As far as I knew, $? is the variable where the last return code was stored, but it doesn't seem to be working in this case. I'm not sure how to check if the transfer was a success or not. Thanks in advance for any help. EDIT: Forgot to mention I am using KSH shell. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|