Delete all files older than two days, except the ones beginning with a specific string
Hi,
I'm trying to delete all files older than two days, except the one beginning with "database*".
I was going with , but no sucess, so I tried but still not working.
I'm trying also with instead of to display the results, and as soon as I use the exclude pipe I get a no result match.
How should I do this ?
I'm running the script through a .bat file with the following code
The goal is to delete all database files older than 30 days, then delete everything else older than 2 days and finally delete all files smaller than 1KB.
Thanks for the help.
Regards,
Joel
I'm trying to delete all files older than two days, except the one beginning with "database*".
I was going with
rm *<2D|database*
rm *|database*<2D
I'm trying also with
ls
rm
|
How should I do this ?
I'm running the script through a .bat file with the following code
"C:\Program Files (x86)\WinSCP\WinSCP.com" ^ /log="C:\Scripts\logs\%~1.log" /ini=nul ^ /command ^ "open ftp://user:pass@exemple.com/ -rawsettings ProxyPort=0" ^ "cd /default/%~1/" ^ "rm database*<30D" ^ "rm *|database*<2D" ^ "rm *<1K" ^ "exit"
The goal is to delete all database files older than 30 days, then delete everything else older than 2 days and finally delete all files smaller than 1KB.
Thanks for the help.
Regards,
Joel