![]() |
|
|
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 |
| scp automated script | gholdbhurg | UNIX for Advanced & Expert Users | 5 | 10-27-2008 01:23 AM |
| Automated shtudown | joe1967 | Shell Programming and Scripting | 5 | 05-29-2007 09:04 PM |
| Automated FTP | shauche | UNIX for Advanced & Expert Users | 11 | 07-11-2002 03:08 AM |
| FTP automated? | n9ninchd | UNIX for Dummies Questions & Answers | 6 | 05-18-2001 11:21 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
automated ftp.
Hi
I am trying to delete some specific files ( files other than created today) from the server on a cron basis. I wrote a small script, but I am stuck up in how to delete only specific files. #!/usr/bin/expect -f set IP [lindex $argv 0] set timeout -1 spawn ftp $IP expect ): send "username\n" expect word: send "password\n" expect ftp> send "prompt\n" expect ftp> send "passive\n" expect ftp> send "cd logs/\n" expect ftp> After this I am stuck up. It is because I want to delete files with old dates ie, I don't want to delete the file dated today. The files are like logfile-070501,logfile-070502 and so on.. I cannot run the command "rm logfile-0705*" ( as it will delete today's file too) By the way, I have the list of files to be deleted in a separate file. I am wondering if by running any other additional script, we can delete selected files from the remote server . I tried with ! command of ftp, but it runs the commands on local machine. Your help will be highly appreciated.Thanks |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|