Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

cpezie

looks promising

Freitag wrote:

Assuming your remote box is unix/Linux/OSX the following ought to work
find /path/to/your/dir/tree -atime +XXX -exec rm {}\;


I would like to use something like this except I want to remove any directories in the dir older then 7 days. So where you have -atime +XXX -exec rmdir -rf {}\ I need to know the syntax for days instead of time and what is the -XXX reference?

Thanks,
AndroidFlo

Thank you all :) you saved me some time looks i'm not the only one need to remove some old files from time to time :)
thoath

Thanks for Your Help,
I find now an own version:
I wrote a windows-bat with 3 commands:

Step 1: Synchronisize the remote-Folder with a local mirror-Folder

Step 2: Start a VB-Script which evaluate the Fileinformation of Files in the local-Folder --> and write a remove-joblist-File for WinSCP

Step 3: Execute the remove-joblist-File with WinSCP

It works fine, but it is not realy elegant.
Best regards and have a nice Christmas
Thomas
Freitag

I don't have a unix server at hand, but you might be able to do it by setting up a remote command. View - Preferences - Commands - Add

Assuming your remote box is unix/Linux/OSX the following ought to work
find /path/to/your/dir/tree -atime +XXX -exec rm {}\;

Where XXX is the number of days older than which you want to delete the files.

You may need to use the -f argument with rm to avoid problems with it trying to run interactively.

This will DELETE files, test it manually in some safe directory first. find is recursive so it will also include directories below the one you indicate and I think it follows links.
thoath

Thanks Martin,
Unfortunately, I can use on the computer no VB.Net, but only VBS.
Ciao Thomas
thoath

Thanks Martin,
Too bad that there's no easier way. I was hoping that I can use the "rm" command in WinSCP-use with a time parameter.
Unfortunately, I'm not really able to use javascript. Therefore, I can not use the variant likely. Do you have an example in VBS.
Ciao
Thomas
thoath

Delete Remote-Files automatically, which are older then xxx

Hi,
please help me. I looked for a script-possibility to delete remote-files on a server, which are older than xxx-Days. The Numer xxx of days (modification time) I want to configure. Is it possible?
Thanks
Thomas