Delete remote files older than

Advertisement

GTypeR
Guest

Delete remote files older than

Hi. I've been trying to figure out if this is possible with WinSCP. However, I can't see if something like the -filemask switch is available for the rm command or if the synchronize command has a remote -delete switch, rather than a local one.

I'm basically trying to upload the latest file and then delete anything over 1 month old on the remote server.

I haven't got SSH access so I can't do it that way.

Reply with quote

Advertisement

Guest

Re: Delete remote files older than

I've just thought, I may just delete the whole remote directory and just use a put command with the -filemask switch to upload the most recent files. I'll do this if there's no cleaner solution.

Reply with quote

schultkl
Joined:
Posts:
4
Location:
USA

I see the following time constraints:
One of the following units must be used: Y (years), D (days), H (hours), N (minutes) or S (seconds).
Might a month constraint exist? Thank you.

Note: we can get close enough for our purposes using 182D instead of 6M...

Reply with quote

Advertisement

Paccatore
Guest

Re: Delete remote files older than

Sorry but rm *<180D doesn't work, error "can't get files attribute" or something like "there are no file", what's the limit?

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,694
Location:
Prague, Czechia

Re: Delete remote files older than

@Paccatore: There's no limit. The problem is likely elsewhere. Please attach a full session log file showing the problem (using the latest version of WinSCP).

To generate the session log file, use /log=C:\path\to\winscp.log command-line argument. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.

Reply with quote

Advertisement

You can post new topics in this forum