#!/bin/bash # /usr/local/sbin/dirvish-post # KHL 10-6-2003 # # This is run after dirvish completes. It assumes Linux clients at the # far end of the pipe, and will need to be modified for other # types of clients. # client and destination, short form. for example, # cl=laptop # de=/backup/dirvish/laptop/laptoproot/2003-1006-0300 cl=$DIRVISH_CLIENT de=$DIRVISH_DEST/.. # server commands ssh='/usr/bin/ssh' # client commands sfdisk='/sbin/sdisk -d /dev/hda ' df='/bin/df ' # Write df files to backup directory (image level) to keep # track of disk usage, in case we need to rebuild a disk. # # This writes the $df info into each vault image, which is # redundant but necessary given that dirvish is configured # for multiple vaults per client. $ssh $cl $df > $de/df.$i # Write sfdisk files to backup directory (client bank level) # in case we need to rebuild a disk. # The file can be fed into sfdisk to rebuild what will become main drive. # This will perform multiple overwrites of the same data. $ssh $cl $sfdisk > $de/../../sfdisk.$i ### uncomment the below if you want to watch what dirvish is doing # /bin/echo -n --------------------------------- >> /tmp/dirv # /bin/echo ------------------------------------- >> /tmp/dirv # /bin/date >> /tmp/dirv # /bin/echo "SERVER = " $DIRVISH_SERVER >> /tmp/dirv # /bin/echo "CLIENT = " $DIRVISH_CLIENT >> /tmp/dirv # /bin/echo "SRC = " $DIRVISH_SRC >> /tmp/dirv # /bin/echo "DEST = " $DIRVISH_DEST >> /tmp/dirv # /bin/echo "IMAGE = " $DIRVISH_IMAGE >> /tmp/dirv # /bin/echo "EXCLUDE = " $DIRVISH_EXCLUDE >> /tmp/dirv # /bin/echo -n --------------------------------- >> /tmp/dirv # /bin/echo ------------------------------------- >> /tmp/dirv exit 0