University Computing Systems


Synchronizing AFS Home Directory to Local Disk


The procedure described here gives faculty members access to a recent version of their AFS home directory when, due to some system problem, that directory is not available. A user may also opt for a local login.

The following utility is available for such a purpose :

/usr/ucs/bin/rsync.afs.sh

rsync.afs.sh takes both a SOURCE and a TARGET directory on the command line and uses the rsync program to perform its operations.

Example of Usage :

rsync.afs.sh -s /afs/cad/u/j/j/jjones -t /export/home/jjones

The above command copies AFS home directory (SOURCE) for user jjones to /export/home/jjones (TARGET). After the above has been run for the first time, any subsequent runs will copy only the changes made in the SOURCE to the TARGET since the last time rsync.afs.sh was run.

Note:

Scheduling via cron :
rsync.afs.sh may be run on a regular basis by scheduling it to run through cron. To schedule a daily cronjob, use the -c option :

rsync.afs.sh -s /afs/cad/u/j/j/jjones -t /export/home/jjones -c

The above will install the above command into the user’s crontab and will run daily at 2:45 am (that time is hard-coded into rsync.afs.sh).

Caveats re: cron

When rsync.afs.sh is invoked through cron, rsync.afs.sh will need to be running with the user’s AFS token in order to read the contents of the user’s AFS home directory. If the user is logged into hi/her workstation, and has their AFS token, rsync.afs.sh will also have that token when it runs, and thus can read the contents of the user's home directory.

However, if the user has logged out of their workstation, or has otherwise lost his/her token, there will be no token available. rsync.afs.sh will detect this situation, and will exit without doing anything.


For questions regarding the use of rsync.afs.sh, or to request additional features, please contact sys@oak.njit.edu.