Hi, I'm trying to write a batch that has to do the following:
-Delete A: \temp
-Create A: \temp
-Copy newest backup file from B: \backup to A: \temp
-Rename file with: backup_%DATE%
-Encrypt with Axcrypt
-Send using Filezilla
So far I got this:
The problem is that Robocopy is copying the las 2 files (I do 1 backup per day). I need to find a way to only copy the newest file or to delete the old one after being copied.
I'm pretty stuck here and I can't continue with the script if I can't solve it.
Thanks.
P.S.: I'm not really sure if that question should go here or in Windows, sorry if I posted it in the wrong place.
-Delete A: \temp
-Create A: \temp
-Copy newest backup file from B: \backup to A: \temp
-Rename file with: backup_%DATE%
-Encrypt with Axcrypt
-Send using Filezilla
So far I got this:
:: DELETE OLD FILES
rd /s /q A: \temp
::CREATE TEMP FOLDER
md A: \temp
::COPY LAST BACKUP TO TEMP
Robocopy "B: \backup" A: \temp /MaxAge:1
The problem is that Robocopy is copying the las 2 files (I do 1 backup per day). I need to find a way to only copy the newest file or to delete the old one after being copied.
I'm pretty stuck here and I can't continue with the script if I can't solve it.
Thanks.
P.S.: I'm not really sure if that question should go here or in Windows, sorry if I posted it in the wrong place.