Topic "Delete remote files older than"

Author Message
GTypeR

Guest


Hi. I've been trying to figure out if this is possible with WinSCP. However, I cant 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 cant do it that way.
Advertisements
Guest




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.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24555
Location: Prague, Czechia
Use rm *<31D.
See
http://winscp.net/eng/docs/scriptcommand_rm
http://winscp.net/eng/docs/file_mask#size_time

Last edited by martin on 2014-10-01; edited 2 times in total
schultkl
[View user's profile]

Joined: 2013-11-14
Posts: 4
Location: USA
The 'M' constraint seems to currently refer to size, rather than time (that is, "M (Megabyte)") .

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...
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24555
Location: Prague, Czechia
schultkl wrote:
The 'M' constraint seems to currently refer to size, rather than time (that is, "M (Megabyte)") .

Thanks for spotting this. I have fixed my previous answer.

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

Isn't that enough?
_________________
Martin Prikryl
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License