SFTP delete files older than x number of days

1

1

How can I delete files at sftp older than x number of days? I'm using WinSCP client to connect to the sftp.

dmarkez

Posted 2012-10-19T01:27:45.103

Reputation:

Answers

1

If you want to do this from GUI, select files to be deleted using a file mask with time-constraint (*<4D for 4 days) and than just delete them.

Some references:
https://winscp.net/eng/docs/ui_select
https://winscp.net/eng/docs/file_mask

If you want to automate it, use rm command with the same mask:
https://winscp.net/eng/docs/guide_automation
https://winscp.net/eng/docs/scriptcommand_rm

Martin Prikryl

Posted 2012-10-19T01:27:45.103

Reputation: 13 764