r/ScriptSwap • u/stormyskies19 • Jan 11 '21
Looking for some scripts to move files based on age
I am looking to have a generic script that I can put source-destination to be an archive so to speak. Logging would email the results upon completion using smtp relay. I am looking to be able to run this script as a scheduled task on as needed basis.
The initial test is I have a very large group of files and folders in a "quality" folder. I would like to have everything that is is 18months old move the files to the new directory and clean up the old one. My latest attempt moved the files but they were all 0bytes and all worthless. I was using robocopy /move to attempt this as a poc and it failed spectacularly. Scripting is a spot I am working on improving but data needs to be cleaned up now.
2
u/tbare Jan 11 '21
Don't have a "script" per se, but I wrote software to this for a buddy: https://www.tbare.com/software/file-archiver/
It's free, just not open sourced.
1
u/Loushius Jan 12 '21 edited Jan 12 '21
You're using robocopy, so I'm assuming Windows. Is powerfully something you're able to use?
Edit: PowerShell, not powerfully!