would need help creating a script that connects to a remote ftp server and deletes files older than 1 month
Hi,
There is a script in the example section that shows how to delete the files older than a week. Chaning the $a_week_ago value to the right amount of seconds will do that:
https://www.scriptftp.com/s/average-scripts/older_than_a_week-ftp
There is a script in the example section that shows how to delete the files older than a week. Chaning the $a_week_ago value to the right amount of seconds will do that:
https://www.scriptftp.com/s/average-scripts/older_than_a_week-ftp
FTP Script
- # Connecto to the FTP server
- # Change current remote directory
- # Retrieve current date and time
- # Substract a month (in seconds) from the current date,
- # assign the result to another variable
- $a_month_ago=$current_date_time-(30*24*60*60)
- # Request the remote file list
- # For each file in the current remote directory
- # check if it is older than a week. If so delete it
liked Script FTP? Try our other product Email Parser