BATCH: file date comparison + deletion ??
LezardMoo
Posted messages
614
Status
Membre
-
dubcek Posted messages 18702 Registration date Status Contributeur Last intervention -
dubcek Posted messages 18702 Registration date Status Contributeur Last intervention -
Good evening everyone!!
So I am currently coding a small batch for file backup.
I would like to compare several archives (containing the same files but modified, they are source code backups) and delete archives older than 2 months.
On Linux, a simple:
find /path -mtime +60 -print | xargs rm -f
and it's done... but not on Windows... apparently the find command is only used to search for strings.
How to do the equivalent on Windows?? any hints??
Thanks in advance ;)
Configuration: Windows 7 / Firefox 15.0.1
So I am currently coding a small batch for file backup.
I would like to compare several archives (containing the same files but modified, they are source code backups) and delete archives older than 2 months.
On Linux, a simple:
find /path -mtime +60 -print | xargs rm -f
and it's done... but not on Windows... apparently the find command is only used to search for strings.
How to do the equivalent on Windows?? any hints??
Thanks in advance ;)
Configuration: Windows 7 / Firefox 15.0.1
3 réponses
hello
download the Unix find for Windows (as well as lots of other commands) here: https://sourceforge.net/projects/unxutils/files/unxutils/current/
look in /usr/local/wbin
no installation, they're just .exe files
download the Unix find for Windows (as well as lots of other commands) here: https://sourceforge.net/projects/unxutils/files/unxutils/current/
look in /usr/local/wbin
no installation, they're just .exe files
hi !! thanks for the help but I've already installed cygwin on the work machine (Windows) and personally I only work under Linux ^^ so I can't do without these commands :):)
unfortunately right now it's not possible because the script I'm making is for other people, it's not a personal script, it's for work so I would have preferred to use only DOS commands.
unfortunately right now it's not possible because the script I'm making is for other people, it's not a personal script, it's for work so I would have preferred to use only DOS commands.
in DOS, tough, tough
with this command https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/cc753551(v=ws.10)?redirectedfrom=MSDN
with this command https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/cc753551(v=ws.10)?redirectedfrom=MSDN