Solved

Need Batch file to create rolling backups of user specified files

Posted on 2004-08-11
7
343 Views
Last Modified: 2012-06-27
Looking for a batch file that will create rolling backups of certain files or folders. For  example when the user clicks on an icon the batch file should run the backup routine. The backup routine backs up the files and folders listed in the file and lables the results Backup 1. When run again the same occurs however Backup 1 is renamed Backup 2 and the newest backup is named Backup 1. A maximum of 5 backups is created with the 6th bieng deleted when the total number of backups reaches 5. I'd like to be able to ammend the list of files and also to specify the location of the backups. Ability to direct backups to a network drive or second local drive is a bonus.
0
Comment
Question by:Abacustechnologies
  • 4
7 Comments
 
LVL 10

Expert Comment

by:For-Soft
ID: 11775416
What OS are you using?
0
 
LVL 10

Expert Comment

by:For-Soft
ID: 11775563
This is the simplest solution I've found:

if exist backup5.zip rename backup5.zip backup6.zip
if exist backup4.zip rename backup4.zip backup5.zip
if exist backup3.zip rename backup3.zip backup4.zip
if exist backup2.zip rename backup2.zip backup3.zip
if exist backup1.zip rename backup1.zip backup2.zip
del backup6.zip
pkzip -r -p backup1.zip c:\temp\1\*.*
0
 

Author Comment

by:Abacustechnologies
ID: 11775711
Sorry All,  Forgot to mention OS is Windows 95 to XP.

Also, this batch file should, IMHO, consist of two parts. The first backs up the list of files and folders it contains while the second creates the actual backup file as well as renaming the backup as indicated by For-Soft.

Hope this clarifies things somewhat.

Dave
0
 
LVL 10

Expert Comment

by:For-Soft
ID: 11775912
It would be good to know, what backup metod should be used.
It is possible to use list file with pkzip compressor.
Arj is also capable of using list file.
0
 
LVL 10

Accepted Solution

by:
For-Soft earned 400 total points
ID: 11776098
pkzip backup1.zip @list
or
arj a backup1.arj !list

---------------------- list
c:\temp\1\*.*
c:\temp\2\*.*
C:\temp\test.txt
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

One of my most closely kept secrets is revealed in this discussion How to output text on the same line This question was recently posted in EE by Simon336697 (http://www.experts-exchange.com/Programming/Languages/Scripting/Shell/Batch/Q_2459…
VALIDATING DATES One method of validating dates is to jam the date into the DATE command and see if it accepts it by examining the system's errorlevel value. A non-zero result indicates failure. A typical example might look something like the fol…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now