Laptop backup/sync service quickstart

For those of you who are familiar with Linux, MacOS or other UNIX-type systems and want to get a simple home directory backup running as quickly as possible please follow these simplified instructions.

  • first of all, ask for an account on the backup service.

  • if not already installed, install rsync on your laptop; Ubuntu users can do this with:

    sudo apt-get install -y rsync

  • create an SSH public/private key pair on your laptop with:

    ssh-keygen -t rsa -b 1024

    and pressing the return key twice when asked for a passphrase (since you don't want one)

  • create a .ssh directory in your backup space on the backup server:

    ssh mkdir .ssh

    where [username] is your college username

  • upload your ssh public key to your account on the backup server:

    scp ~/.ssh/

  • download and save the backup script sync2lapback and (optionally) auto-backup2lapback scripts to your laptop

  • edit the sync2backup script and

    1. on line 10 replace 'MY_LAPTOP_HOME_DIRECTORY' with the name of your home directory on your laptop
    2. on line 11, replace 'MY_COLLEGE_USERNAME' with your own college username

  • move the edited sync2lapback and (optional) auto-backup2lapback scripts to /usr/local/bin (optional but less likely to get accidentally deleted there):
    sudo mv sync2lapback /usr/local/bin
    sudo mv auto-backup2lapback /usr/local/bin

  • change the permissions of these two scripts to make them executable:
    sudo chmod 755 /usr/local/bin/sync2lapback
    sudo chmod 755 /usr/local/bin/auto-backup2lapbackup

  • test the new sync2lapback backup script


  • if you want automated backups to start shortly after you switch on your laptop, edit your crontab and add these entries:

    # start the auto-backup 5 minutes after booting
    @reboot sleep 300; /usr/local/bin/auto-backup2lapbackup
    # retry at 10, 15 and 20 minutes after booting if earlier attempts fail
    @reboot sleep 600; /usr/local/bin/auto-backup2lapbackup
    @reboot sleep 900; /usr/local/bin/auto-backup2lapbackup
    @reboot sleep 1200; /usr/local/bin/auto-backup2lapbackup

See the main documentation if anything here is not clear or if you want to sync (not backup) your laptop or back up only parts of your home, directory, memory cards and cameras, phones, etc attached to your laptop. Let me know if you have any problems with the new system and any feedback/suggestions will be gratefully received.

Andy Thomas

Research Computing Manager,
Department of Mathematics

last updated: 25.10.2016