Is it just み?

Simple backups with windows 2

by on Dec.03, 2009, under Programmierung, Technik

Ich werde mal versuchen einige meiner Einträge auf Englisch zu verfassen – um in der Übung zu bleiben.

Update: I made additional changes to the script which are a real improvement for my daily use. The current version is “0.3d [2010-01-08]”

Last week I wrote about a simple way to zip all subfolders of a specific folder which I use for my simple archiving strategy at work. Today I would like to show you a simple script I wrote which backups files listed in a configuration file using rar and puts them into a single archive named after the current date and time. I wrote it to be used as a scheduled task that runs every few hours on some windows machine that is always on.1

I will not show the complete code here, since it’s about 150 lines. You can download the whole script package as .zip-archive.

The archive contains four files:

INFO-README.TXT Some Information about the script
KPSBackupList.ini The file containing the list of files to backup. Can be changed in the KPSFileBackup.bat
startHidden.vbs Just a simple Script file to start the batch file without showing a console-window
FileBackupConfig.bat The batch config file. It contains the config-section where you can change the settings as explained below
KPSFileBackup.bat The actual batch file, you may run.

The following settings are available:

backupFilelist The file containing the list of all files that should be backed up
destinationDir Destination directory where all backup files are stored
prefix The prefix is put before the date in the name of the backup file
retryTime Number of seconds to wait before retrying if one of the files was open and could therefore not be put into the archive. This is an approximate value since I hadd to use a workaround to put the script to sleep.
maxRetries Number of times the script will retry if one of the files was open
backupsToKeep The number of old backups to keep
rarPath Path to the RAR2 executable file

1 The reason for using a batch script and a Windows machine is simple: They do not use linux here. Though I might get my own litte Debian VM in the future, for now Windows has to suffice.

2 The reason for using RAR is simple: It comes preinstalled on all machines here.

Ähnliche Beiträge

:, , , , ,

Comments are closed.