Rosemount Technology logo

Technical Tips

This page is for our contribution to the Open Source community.

Disclaimer - You use the information on these pages at your own risk. We make our living from selling our services so if you need support on this stuff please buy it from us.

Now you have read the disclaimer - if you have a question or a correction or suggestion then e-mail us.

Windows in this context is a registered trademark of Microsoft.

The Bash scripts below were based on a backup script written by Adam Neat that you can find on the internet. The objective of the script is to back up Windows shares onto a Linux server running Samba. The original idea was to have a master script calling a script to back up Windows machines and another script to back up Linux machines. The second script has never been written as either rsync is used or the Linux clients run Samba and are backed up using the win_backup script. The master script is net_backup.sh and the script for backing up Windows machines is win_backup.sh. There is a small file called backup_cfg.txt which contains the following lines :-

recurse
prompt
mget *
exit

This file contains the commands that are piped into smbclient. The original idea was that they could be changed for each share but this has never been used in practice.

The scripts are run from a user account called admin which can be any account but preferably not root. A directory called backup is created in the user's top level directory with subdirectories called current, old and temp. The scripts move data from current to old, delete the data from current and back up the new data into current. The master script (net_backup.sh) is run as a cron job at 1 a.m. and therefore the following morning there is the previous days data and the data from the day before that available.

The scripts do not consider Saturday or Sunday to be special as they are potentially days when some work maybe be done especially if a project needs to be finished.

When a share is deleted or changed and a new directory name is created in the master script then any directory names that are not in the master script are not deleted. A decision was taken to manually delete these.

The scripts were initally installed a part of a backup solution for a design studio and have been working for nearly two years without a problem. The Directors of the studio consider that the system paid for itself in less than a year.



Are you concerned about losing data because of computer failure or problems with a virus?
Are your backups held off-site?
Contact us for a no obligation discussion on how to secure your data.

Rosemount Technology