Solved

Need Batch file to create rolling backups of user specified files

Posted on 2004-08-11
7
344 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Script to 9 64
command line argument to replace text in a file 4 59
how to get the largest file size? 33 55
file size 9 39
The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
Being a system administrator some time we require to do things remotely, one of them is installing software. Here I am going to tell you how to install software through wmic (Windows management instrument console). I am not at all saying that this i…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

930 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

10 Experts available now in Live!

Get 1:1 Help Now