Robert Thun
asked on
How do I create a Robocopy script that will copy new files from folder A to folder B then delete files on folder A that are older than 365 days.
How do I create a Robocopy script that will copy new files from folder A to folder B then delete files on folder A that are older than 365 days.
Here is my current script to copy
C:\WINDOWS\system32\ROBOCO PY.EXE "D:\Folder A" "S:\Folder B" *.* /NP /B /Z /E /R:10 /W:30 /M /copyall /V /COPY:DT /LOG:Audioback.txt
I would also like the script to let me know which files were deleted in folder A.
Bonus would be to have script also zip the deleted files.
Here is my current script to copy
C:\WINDOWS\system32\ROBOCO
I would also like the script to let me know which files were deleted in folder A.
Bonus would be to have script also zip the deleted files.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks I will test this.
ASKER
I tested this and it is not deleting the hidden files in the structure. Any way to curtail this issue?
Was thinking this?
forfiles /p D:\Folder A /s /m *.* /d -365 /c "cmd /c del /a:HR @file && echo @path >> C:\Path\To\Log.txt"
Also is there a way to verify that the file is in Folder B before removing it from Folder A?
Is this script looking at modified or created date?
Was thinking this?
forfiles /p D:\Folder A /s /m *.* /d -365 /c "cmd /c del /a:HR @file && echo @path >> C:\Path\To\Log.txt"
Also is there a way to verify that the file is in Folder B before removing it from Folder A?
Is this script looking at modified or created date?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER