Skip to content
Advertisement

Bash script – delete old files

I have a script that uploaded a compressed file to an ftp, it is the code that I show below.

This code works correctly, but I would like to adapt it so that once the file is uploaded, it deletes ftp files older than a week.

JavaScript

Advertisement

Answer

You can try this solution:

JavaScript

Note: I have commented the Remove file line, so that you can check and run !

Advertisement