- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- I need a perl script to delete files on the ftp se...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-12-2004 03:24 AM
тАО01-12-2004 03:24 AM
I need a perl script to delete all files
beginning with cm* and older then 1 week
via ftp, on the ftp server.
kind regards
chris
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-12-2004 03:33 AM
тАО01-12-2004 03:33 AM
Re: I need a perl script to delete files on the ftp server older then 1 week
find / -name "cm*" -mtime +7 -exec rm {} \;
or something like that... ( man find ).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-12-2004 03:40 AM
тАО01-12-2004 03:40 AM
Re: I need a perl script to delete files on the ftp server older then 1 week
and I can connect only via ftp.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-12-2004 03:51 AM
тАО01-12-2004 03:51 AM
Re: I need a perl script to delete files on the ftp server older then 1 week
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-12-2004 04:41 AM
тАО01-12-2004 04:41 AM
Re: I need a perl script to delete files on the ftp server older then 1 week
but the external server is AS400
and doesn't understand ssh
I CAN CONNECT ONLY VIA FTP
and no other way.
so I need a script
regards
chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-12-2004 04:56 AM
тАО01-12-2004 04:56 AM
Re: I need a perl script to delete files on the ftp server older then 1 week
ls -al
then parse the file, and create a command file deleting only the files matching yout criteria.
ans issue the command file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-12-2004 08:28 AM
тАО01-12-2004 08:28 AM
Re: I need a perl script to delete files on the ftp server older then 1 week
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-13-2004 09:24 PM
тАО01-13-2004 09:24 PM
Re: I need a perl script to delete files on the ftp server older then 1 week
Login, go the the directory and do ls -lt cm*. There find the file that is old enough to delete and then use all filename and all older to delete.
First check by running from the command line if your AS/400 ftp server supports the ls -lt and then I might give it a start by writing something for you... Or perhaps Procura sees this thread and does it...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-13-2004 11:53 PM
тАО01-13-2004 11:53 PM
Re: I need a perl script to delete files on the ftp server older then 1 week
what do you mean with exactly
" old enough to delete with ls -lt cm* " ?
how old files will be deleted ?
this is very important for me to know.
kind regards
chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-14-2004 05:06 PM
тАО01-14-2004 05:06 PM
Solutionmy found_delete=0;
my delete_from=currentdate - 1week;
while (line=readline(FI)) {
if (!found_delete) {
pd=parse_date(line);
if (pd < delete_from) {
found_delete=1;
}
}
if (found_delete) {
writeline(FO,"DEL ".getfile(line));
}
}