User Tools

Site Tools


backup:laptops

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
backup:laptops [2008/08/19 08:59] cangianibackup:laptops [2023/10/09 12:33] (current) admin
Line 1: Line 1:
 ====== Backup of Laptops ====== ====== Backup of Laptops ======
-Laptops are the nightmare of any system-manager. Not only they are always a special case, therefore taking the same amount of work as 50 identical workstations, but also (and more importantly), their backup is under the only responsability of the user. 
-The files on a laptop are much more in danger than those on a workstation or on a file server: the laptop HardDisk is smaller and more fragile, the laptop can get stolen or lost, laptops get into many different uncontrolled networks.... 
-Nevertheless, we know that very few users backup their data on a regular basis.  
-As Laptops become more and more convinient to use, the important work data also becomes more and more in danger. It is useless to have a sophisticated centralized backup system as the one described above if users keep their important data on their laptop. So **please backup your work data as often as possible**. Afterall, your work data belongs to EPFL. 
  
 +===== EPFL Backup System for Laptop ====
  
-===== Syncronizing work stuff with Unison ===== +** All Employee of EPFL are required to do regular backups of the laptop computer they use **\\ 
-[[http://www.cis.upenn.edu/~bcpierce/unison/|Unison]] is a file-synchronization tool for Unix and Windows. Here we show how it can be used to keep the work stuff on your laptop in sync with your home directory on the file server. +For this reason EPFL provide backup service (aTempo Lina) free of charge that every user can request to use.
-Here is short check list of the things to do: +
-  - install unison +
-  - cleanup your directories +
-  - chose and/or prioritize what to backup +
-  - decide what to exclude from the backup +
-  - setup unison configuration files and startup scripts+
  
-==== Install Unison ==== 
-You can either download it directly from the [[http://www.cis.upenn.edu/~bcpierce/unison/download.html|official web site]], or use a precanned package from your favorite distribution. Unison is included in most linux distribution and on both [[http://fink.sf.net|fink]] and [[http://macports.org|mac ports]] for Apple OS X. For a nice feedback from the backup scripts, we also suggest to install the [[http://growl.info/|growl notifier]] on OS X and libnotify on Linux. 
  
 +===== Personal Laptops =====
  
-==== Cleanup your files ==== +The Unit IT staff doesn't provide direct support to personal laptopsbut you can use different services of our filer structure to your gainThe use of these services, as backup systemis under your only responsibility, the unit do not control what you do and how you do it.
-Let's classify our files as //static// or //dynamic// files, and as //personal// or //professional//. Static files are created once and modified at most very rarely ase.g. pictures, mp3 files, or pdf of downloaded papersDynamic files are those that you edit often as, e.g. the latex source files of your latest revolutionary scientific paperyour program sources as well as your contact list. Off-course dynamic files are those that need particular attention and a more frequent backup. Lucklydynamic files are typically much smaller than static ones. In factvery often most of the space on the disk is taken by personal static data (pictures, movies and music collection).+
  
-<note> 
-Please **do not use our server for storing your personal static data**. Buy yourself an external Firewire or USB hard-disk instead. The backup of our home directories on tapes takes a long time and the tapes have limited capacity. It is impossible to backup tens of GigaBytes of non-work-related data for every user. The largest the stuff to backup the less frequent and safe the backups are. Please, respect the other users by keeping our disk usage on the servers as limited as possible. 
-</note> 
  
-==== Synchronization policies ==== +===== Access file servers using you Personal Laptops =====
-We suggest to use two different policies (two separate configuration files) for synchronizing your data.  +
-  - a frequent (hourly) and automatic synchronization for all your dynamic data (we accept here also your personal files if they are not too large); +
-  - an on-demand or less frequent for professional static files.+
  
-==== What to exclude? ==== +  - Homedir: the home directory is used to store your work related documents/programs/stuff, but you can use it also to store some personal related data (photos/images, videos, documents) if the footprint is relatively small (under 100 GB). 
-Clearly any file that is derived from another one (e.g. compiled files like object .o files, and latex output .dvi filesshould be excluded from any backupStrictly speaking synchronization is not a backup but excluding non source files will speedup your synchronization process.+  - Scratch server: The scratch server provide space for everyone and there's no imposed limit (time or spaceon its usePlease use it as you like, but adopt a fair play policy, as everyone in the Unit will need to store data. 
 +  - google disk/dropbox/microsoft onedrive: these and others internet services are offering storage space for your personal data, **but their storage/use policy is not always in line with the rules of EPFL, the European GDPR and/or the Swiss laws regarding privacy** . Please refer to official EPFL documentation/policies about the  use of cloud services.
  
-It is sane to **use only one synchronization system** for a given file. Version control systems are in fact synchronization systems. Therefore one should exclude also all the files that are alreadt under version control (cvs, svn, mercurial...). 
-I use to to append ''_svn'' to the name of any directory containing only files under version control and add the ''*_svn'' pattern to my exclude list. 
  
-==== Configuration example ==== 
-Unison is easy to use, once the configuration file is set.  
- 
-$ unison -batch myPolicy 
- 
-where ''myPolicy'' is the name of the policy to use and is described in a file with the same name under the ''$HOME/.unison'' directory. 
- 
-Here is how my main configuration file looks like: 
- 
-<code> 
-# Roots of the synchronization 
-    root = /Users/cangiani 
-    root = ssh://cangiani@algosrv5.epfl.ch/ 
- 
-# Here is what I want to keep in sync 
-    path = Archives 
-    path = Documents 
-    path = Learn 
-    path = Notes 
-    path = Projects 
- 
-    ignore = Path Documents/Local 
- 
-# Some regexps specifying names and paths to ignore 
-    ignore = Name temp.* 
-    ignore = Name *~ 
-    ignore = Name .*~ 
-    ignore = Name .o~$ 
-    ignore = Name *.{o,x} 
-    ignore = Name *.{tmp,aux,log,dvi} 
-    ignore = Name *_svn 
-    ignore = Name *.sparseimage 
-    ignore = Name .DS_Store 
- 
-# always use rsync for sending files 
-    rsync = true 
- 
-# first treat smaller files 
-    sortbysize = true 
- 
-# On Mac the default FS is case insensitive   :   
-#    ignorecase = true 
- 
-# Log actions to the terminal 
-    log = true 
- 
-# Specific settings 
-    key = 1 
-    label = Learn directory 
-    batch = false 
-</code> 
- 
-Please refer to the [[http://www.cis.upenn.edu/~bcpierce/unison/download/releases/beta/unison-manual.html|official documentation]] for all the details. 
- 
-<note> 
-**Be careful with ignore files!!!** 
- 
-  
-Here is an extract from the official documentation: 
- 
-It is important to be a little careful when renaming directories containing “ignore”d files.  
-For example, suppose Unison is synchronizing directory A between the two machines called the “local” and the “remote” machine; suppose directory A contains a subdirectory D; and suppose D on the local machine contains a file or subdirectory P that matches an ignore directive in the profile used to synchronize. Thus path A/D/P exists on the local machine but not on the remote machine. 
- 
-If D is renamed to D' on the remote machine, and this change is propagated to the local machine, all such files or subdirectories P will be deleted. This is because Unison sees the rename as a delete and a separate create: it deletes the old directory (including the ignored files) and creates a new one (notincluding the ignored files, since they are completely invisible to it). 
-</note> 
- 
-==== Do it! ==== 
-Now that you've prepared and tested your perfect configuration file, it is time to make sure that unison is executed periodically. On unix (linux and mac) you can symply call unison from a script like the following: 
-<code> 
-#!/bin/sh 
- 
-# make sure to use always the same hostname even if the actual address of the laptop is variable 
-export UNISONLOCALHOSTNAME=giovanniMBP 
- 
-# make sure to be at EPFL connected on a wired connection 
-ifconfig | grep 128.178.70 > /dev/null 2>&1 
-if [ $? eq 0 ] ; then 
-  unison -batch main 
-fi 
-</code> 
-and launch the script periodically as a cron job. Edit your cron table (''crontab -e'') and add something like 
-<code> 
-38 8-20/2 * * * /Users/cangiani/Desktop/unison.command 2>&1 > /dev/null 
-</code> 
-which runs the script every 2 hours between 8:38 am and 8:38 pm. 
- 
-Note that the line  
-<code> 
-export UNISONLOCALHOSTNAME=giovanniMBP 
-</code> 
-of the above script is quite important because the database used by unison for keeping track of which files are changed since last sync depends on the host-name (address) of your machine. Since the laptop gets a different ip address and, therefore, a different host-name each time it is connected to the network it happens often that you have false conflicts: a file is supposed to be changed on both machines only because it was synced on a previous run with a previous host-name. 
- 
----- 
- 
-Here is a nicer version of the launch script that keeps you notified about the result of your automatic synchronization: 
-<code> 
-#!/bin/sh 
- 
-export UNISONLOCALHOSTNAME=giovanniMBP 
- 
-ifconfig | grep 128.178.70 > /dev/null 2>&1 
-if [ $? -eq 0 ] ; then 
-  ofile=$(mktemp /tmp/unison.XXXX) 
-  unison -batch main 2>$ofile 1>&2 
-  if [ $? -eq 0 ] ; then 
-    msg=$(grep "Synchronization complete" $ofile; grep "Nothing to do:" $ofile) 
-#    notify-send -u low "Unison Sync OK" "$msg"                  # linux version 
-    growlnotify --title "Unison Sync OK" -p Low -m "$msg"       # mac version 
-  else 
-    msg1=$(grep "Synchronization complete" $ofile) 
-    msg2=$(grep '<-?->' $ofile | grep "new file" | head -n 1) 
-    msg3=$(grep '<-?->' $ofile | grep "changed" | head -n 1) 
-#    notify-send -u critical -t 0 "Unison Sync Err" "$msg1 $msg2 $msg3"        # linux version 
-    growlnotify --title "Unison Sync Err" -s -p High -m "$msg1 $msg2 $msg3"   # mac version 
-  fi 
-  rm $ofile 
-fi 
-</code> 
backup/laptops.1219136392.txt.gz · Last modified: 2008/08/19 08:59 by cangiani