Question

I'm searching for a solution to easily delete files on a SFTP server automatically after a specific period of days.

I read something about automation via PSFTP from PuTTY and WinSCP. But there are no examples for deleting files...

Was it helpful?

Solution

With WinSCP, use the rm command with a filemask with a time constraint (to select only files with certain age, if I understand correctly, what you want to do).

E.g. to delete all files older than 5 days:

rm *<5D

For all the other instructions to assemble a script and schedule its run, see:

See also:

OTHER TIPS

SFTP server is also a SSH server. Write a simple code in any language that you're comfortable with and schedule it with crontab.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top