-
Notifications
You must be signed in to change notification settings - Fork 0
hariguchi/backupfs
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
backupfs A clone of Plan9's dumpfs Yoichi Hariguchi Usage: 1. backupfs /full/path/of/target /full/path/of/backups This makes a daily snapshot of /full/path/of/target under /full/path/of/backups. For example, assume `backupfs' is executed on July 20, 2015 for the FIRST TIME, everything under /full/path/of/target is copied to the following directory: /full/path/of/backups/2015/07/20/full/path/of/target Now assume it is executed on July 23, 2015 for the second time (`backupfs' does not require to be executed everyday), everything under /full/path/of/target is copied to the following directory: /full/path/of/backups/2015/07/23/full/path/of/target For the second time and after, only new and changed files are copied. The files with no change were hard-linked to the same file under /full/path/of/backups. Both target and backup directories must be full path. 2. backupfs host:/full/path/of/target /full/path/of/backups This does the same thing as '1.', but the target directory is located in a remote host called "host". `backupfs' uses ssh to copy; you need to create an ssh key pair. See below for more details. How to install: 1. LOCAL AND REMOTE BACKUPS 0. Install boost C++ Libraries (http://www.boost.org/) 1. WINDOWS ONLY: install cygwin including sshd http://www.cygwin.com/ http://pigtail.net/LRP/printsrv/cygwin-sshd.html on the windows machines which you want to run backupfs client. Windows machines can become *ONLY* backupfs clinets. 2. Open the backupfs source package on local host (server) and remote hosts 3. Run "make" on local host and remote hosts 4. Become root (Administrator on Windows) and run "make install" on local host and remote hosts. 2. UNIX BACKUPFS SERVER 1. Run "make ssh-keygen" to create an SSH authentication key pair with no passphrase. 2. Copy the secret key (id_rsa) to the backup root directory for a remote host as .id_rsa. If the backup root directory for host foo is /backup/foo, copy id_rsa as /backup/foo/.id_rsa. You can use the same secret key for multiple hosts as well as use a different key for each remote host. 3. WINDOWS REMOTE BACKUPFS CLIENTS 1. Create an account "backupfs" with "Computer Administrator" privilege on a Windows machine 2. Run the following commands in a cygwin shell console: # ssh Administrator@localhost # mkpasswd -l > /etc/passwd 3. Change the group of all the files and directories under the top directory to be backed up to root. Use the following command if the top directory is /cygdrive/c/Documents\ and Settings/foo: chgrp -R root /cygdrive/c/Documents\ and Settings/foo 4. Change the access mode of all the files and directories under the top directory to be backed up so that backupfs can read. The following is example commands when the top directory is /cygdrive/c/Documents\ and Settings/foo: # find /cygdrive/c/Documents\ and Settings/foo -type d \ -exec chmod 750 {} \; # find /cygdrive/c/Documents\ and Settings/foo -type f \ -exec chmod 640 {} \; 4. REMOTE BACKUPFS CLIENTS 1. Add the matching SSH authentication public key (created in Section 2.1) to the $HOME/.ssh/authorized_keys file on each remotehost. In the above example, add the content of id_rsa.pub to foo:/home/backupfs/.ssh/authorized_keys. 2. Run backupfs against each remote host interactively. This is necessary to add SSH host keys to /root/.ssh/known_hosts. For example, run "backupfs foo:/etc /backup/foo" if you want to back up /etc on remote host foo into /backup/foo on the local host. 3. Once backupfs is run interactively against a remote host, you can use backupfs to back up the remote host's directories non-interactively.
About
Daily Backup System similar to Plan9's dumpfs
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published