The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



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

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 05-03-2007
sangfroid sangfroid is offline
Registered User
  
 

Join Date: May 2007
Posts: 5
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
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 12:10 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0