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...

有帮助吗?

解决方案

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:

其他提示

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top