Auto Backup of Files in Windows
From OpenFSG
Backing up your files regularly is a good idea and the FSG is perfectly suited for the task. There are multiple ways to do that:
Contents |
Using rsync
Use rysnc on the FSG and (for Windows users) DeltaCopy on your machine. This is a very good choice if you have lots of data e.g. 500MB in total to keep in sync (backup to the FSG) but only some MB change every day (or even nothing). rsync copys only the data which has changed since the last backup! Speeds up things a lot. There are different ways of setting this up, depending on your needs and OS:
- you can have the FSG initiate the backup process (not part of this article) or
- set your machine to initiate the backup:
- if you have a UNIX-compatible machine, e.g. with Mac OS X, Linux, or a "real" UNIX, you can skip step 1 for installing rsync on the FSG and then set up rsync on your machine (which should already be installed by default) so that it connects to the FSG according to steps 3-15.
- if you have a Windows-machine (NT-XP, Vista already has some UNIX-support in Ultimate edition, if you have that, no need for something else), you will need either
- Rsync like cygwin, see Rsync#How_to_use_it_to_backup_from_windows_with_Cygwin_to_your_FSG on your machine to enable backups or
- DeltaCopy, which I prefer (easier and more comfortable) and explain here:
Creating backups from Windows to the FSG using rsync and DeltaCopy
- install Rsync on your FSG
- install DeltaCopy on your Windows machine. There is no need to configure the DeltaCopy Server!
- Login to your FSG as root via SSH
- vi rsyncd.conf in /opt/etc/ and insert
motd file = /opt/etc/rsyncd.motd log file = /var/log/rsyncd.log pid file = /var/run/rsyncd.pid lock file = /var/lock/rsyncd.lock [backup] path = /home/backup/ comment = rsync Backup Server list = yes uid = username gid = backup read only = no # auth users = username # secrets file = /opt/etc/rsyncd.secrets
You have to insert the username and group you like to use for backup and specify a valid path.
- create /opt/etc/rsyncd.motd
touch /opt/etc/rsyncd.motd
- add in /etc/inetd.conf (not absolutely necessary I think):
rsync stream tcp nowait root /opt/bin/rsync rsync --daemon --config=/etc/rsyncd.conf
- add to /etc/services:
rsync 873/tcp rsync 873/udp
- open port in your firewall if you want access from outside (Internet) to rsync (CAUTION THIS OPENS A PORT FOR YOUR FSG, SECURITY RISK!! BETTER USE SSH TUNNELING ACCORDING TO DeltaCopy FAQ). NOT NEEDED FOR LOCAL NETWORK-BACKUP (if you're directly connected to the FSG):
iptables -A INPUT -p tcp -m state --state NEW -m tcp --dport 873 -j ACCEPT
You will have to set this every time you reboot the FSG, so better put in into a script which starts at boot time, e.g. the same that starts rsync daemon (next step).
- execute
rsync --daemon --config=/opt/etc/rsyncd.conf
- execute
- to start the rsync daemon each time the FSG boots see here or just change in /opt/etc/default/rsync
RSYNC_ENABLE=true and maybe (not necessary) RSYNC_OPTS='--config=/opt/etc/rsyncd.conf'
Everything else should already be arranged by the rsync installer (links in rc.optware, /opt/etc/init.d/S56rsync file etc.
- changemod the directory for backup so that all group (e.g. backup, see above) users have full access and every file always is created belonging to the group
chmod g+s backup /home/backup/
- Start DeltaCopy Client, create new profile, Virtual directory is backup (see above in rsyncd.conf , there is [backup], test connection.
- maybe use some or all of the following options (additional parameters) in DeltaCopy:
-rzt --delete-excluded --delete-during --filter "- Temporary Internet Files" --exclude "NTUSER.DAT" --exclude "ntuser.dat.LOG" --exclude "UsrClass.dat" --exclude "UsrClass.dat.LOG" --exclude "Mozilla/Firefox/Profiles/*/Cache/" --exclude "*.lock" --exclude "*/Recent/*" --exclude "*/Temp/*"-rzt is very important!
More information on Rsync is here and on the Internet (man rsync).
Using SyncBack (for Windows)
Use a program called SyncBack. You can schedule automated incremental backups of your data with it.
Preparation
- Download and install SyncBack.
- Create a Folder on the FSG that you want to backup your documents to
- If you are going to backup using the FSG's FTP server there are a few extra steps
- Enable the FTP server from the FSG's web interface
- If you are going to backup using the FSG's FTP server there are a few extra steps
(more to come)
