I currently have backup files that are sent to AWS using batch files embedded in windows tasks.
In addition I have a purge task which deletes old backup files after an X amount of days.
Now the issue since the purge tasks runs every night and it needs to keep running I worry that it can delete files which still haven't been uploaded to AWS since some of the files are big (>>>600 GB )
This is my current script which uploads files & logs a trail into a text doc.
@echo START - ABC: %date% %time% >> P:\Aws_times\Daily\ABC\ABCAWSDaily.txt
aws s3 sync P:\Backups\Daily\ABC s3://backups-daily/ABC
@echo END - ABC : %date% %time% >> P:\Aws_times\Daily\ABC\ABCAWSDaily.txt
This is my purging script which deletes files older than 3 days
forfiles -p "P:\Backups\Daily" -s -m *.* -d -3 -c "cmd /c del @path"
Now my questions are:
1. How do I add a script which deletes a file ONLY after it's been uploaded to AWS?
2.In the log files (ABCAWSDaily.txt), there's only time, how do I script it for it to tell me which exactly files have been uploaded?
3. Can this be done by just editing the batch command or do I need to use powershell & if so since I'm a newbie how do I go about it?
Please let me know if this is clear.
Any help regarding this would be appreciated.
To know where you're heading, you gotta know where you been