|
Posts: 2,084
Joined: November 2006
|
|
#59067
12/18/2013 10:09 AM
|
Joined: Apr 2012
Posts: 82
Member
|
OP
Member
Joined: Apr 2012
Posts: 82 |
AC backups fill up the hard drive in about a week. Can anyone help with syntax of batch file to delete backups more than 5 (or n) days old? Following did not work. Does anyone know the correct solution?
del F:\AmazingCharts\Backup\ *.* /s /d -5
|
|
|
|
Joined: Apr 2011
Posts: 2,316 Likes: 2
G Member
|
G Member
Joined: Apr 2011
Posts: 2,316 Likes: 2 |
|
|
|
|
Joined: Apr 2012
Posts: 82
Member
|
OP
Member
Joined: Apr 2012
Posts: 82 |
Thanks, Sandeep. Can you post this batch file in an area where people can access it anytime. I searched for it before posting and did not find it. Or better put it in helpful downloads file forum. I am going to copy your batch file here so people can see it. forfiles -p "C:\Amazing Charts\Backup" -s -m *.enc* /D -30 /C "cmd /c del @path" If you open up notepad Enter the following line: forfiles -p "C:\Amazing Charts\Backup" -s -m *.enc* /D -30 /C "cmd /c del @path" - "C:\Amazing Charts\Backup" is the path to your AC Folder.
- The 30 means clear files older than 30 days. Adjust accordingly.
Then save the file with the extension .bat, that will create a batch file which you can click to run the script. You can also use the task scheduler to make it run on a daily basis. It's a very useful script. You can use it to clear old faxes in the fax console (Mainpine users) or clear old backups on an external drive.
|
|
|
|
Joined: Apr 2012
Posts: 82
Member
|
OP
Member
Joined: Apr 2012
Posts: 82 |
That will be a great idea, to compile the tips and tricks in a thread on the mainboard so that people do not have to keep asking the same questions again and again. You can call it "Tricks Every Amazing Charts User Should Know". Believe me, I searched for "batch file" before this posting. I did not come across your original post, until you pointed me out to it. Your blog is very helpful, by the way, keep it up!
|
|
|
|
Joined: Sep 2012
Posts: 342 Likes: 7
Member
|
Member
Joined: Sep 2012
Posts: 342 Likes: 7 |
Dear SanjeevP, A site-limited Google search will show what you want right away: http://tinyurl.com/paeomabGoogle's display makes it easier to find what you want. As the example above shows, you just add a site:limit to a normal Google search: site:http://amazingcharts.com/ub batch file delete backups Save the search to your browser favorites to avoid retyping the tedious "site:http://amazingcharts.com/ub" whenever you want to search the AC forum. Cheers, Carl Fogel
|
|
|
|
Joined: Apr 2012
Posts: 82
Member
|
OP
Member
Joined: Apr 2012
Posts: 82 |
Sandeep,
For some reason my batch files are not working.
1. What is "-p" and does it have to be there? 2. For "cmd /c del @path" am I supposed to substitute path with my path and do I leave as it is quotes and all?
|
|
|
|
Joined: Sep 2003
Posts: 12,874 Likes: 34
Member
|
Member
Joined: Sep 2003
Posts: 12,874 Likes: 34 |
Nothing against Sandeep's script, and scripts are great when they are the only thing around, but I will never understand why no one takes advantage of the free program Auto Delete . You can do so much more with it, and I think you will find it more stable in the long run.
Bert Pediatrics Brewer, Maine
|
|
|
0 members (),
98
guests, and
15
robots. |
Key:
Admin,
Global Mod,
Mod
|
|
|
|
|