Search code examples
sftpputtywinscp

Automated delete on SFTP server (PuTTY? WinSCP?)


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


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: