Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question

migrated from stackoverflow.com Oct 22 '12 at 7:20

This question came from our site for professional and enthusiast programmers.

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

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

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

share|improve this answer

You must log in to answer this question.