Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss] Ubuntu USB Drives appending _ to folder



On 06/20/2012 09:52 AM, John Abreau wrote:
> Whenever this happens, the old directories will be on the root filesystem.
> I suppose your script could check for that.
> 
>     mount | grep ' on /media/Nagios_Backup' | cut -d' ' -f3
> 
> will return the directory with the prefix "Nagios_Backup" that is actually
> in use as a mount point.

A few additions:
	the command 'mountpoint -q' to check the mount mount might be useful
(On ubuntu 12.04 it's on the initscripts package). A lazy umount can
also help (umount -rl).
	I would setup a fixed mount point, instead of relying on automount,
using the UUID= or LABEL= on the fstab, see the blkid command.
	I have something like the following to backup the whole system to
another raid disk system. You can improve it by using rsnapshot instead.
			Regards,
				Nuno

fstab, change where needed:
UUID=put_here_the_blkid_uuid_for_the_usb_drive /backup/system ext4
noauto,relatime,errors=remount-ro    0       2


simple script:
#!/usr/bin/env bash

BACKUP=/backup/system

function cleanup {
    # lazy umount, remount read-only if fails
    umount -rl ${BACKUP}
}

trap "cleanup" exit

echo "* begin $(date)"
mountpoint -q ${BACKUP} || mount ${BACKUP}
rsync -axhhS --stats / ${BACKUP}
rsync -axhhS --stats /boot/ ${BACKUP}/boot/
echo "* end $(date)"


-- 
http://aeminium.org/nuno/



BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org