Pregunta

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

¿Fue útil?

Solución

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:

Otros consejos

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

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top