:: Re: [DNG] backup
Top Page
Delete this message
Reply to this message
Author: Rod Rodolico
Date:  
To: dng
Subject: Re: [DNG] backup
As an aside, I have a set of USB drives at a client location. All have
the label "archives" on the partition. I then create an fstab entry:

LABEL=archives /media/archives ext4 noauto 0 2

or something like that (I don't remember the exact entry). They swap the
drives out at will, and just before the backup begins, I try to mount
/media/archives.

The client wanted to rotate 5 drives throughout the week to back up the
backup service we provide, and it has worked well for them.

Rod

On 5/19/20 10:56 AM, william moss via Dng wrote:
> If you set the partition label for the target of a file system archive,
> then the use of findmnt eliminates the need for a special location. For
> example:
>     findmnt -P -t ext4,xfs -o source,target,label

>
> Note, the file systems in the example should be set to what you use for
> your archive media.
>
> Since I back up to network attached storage, I parse the output of the
> following command to find a sub-directory of the primary mount points.
> findmnt -P -t cifs,nfs,auto -o source,target,label |& \
> while read Q
> do
>   [[ "${Q}" =~ LABEL=\"([^\"]*)\" ]] &&     
>     LBL="${BASH_REMATCH[1]}"
>   [[ "${Q}" =~ TARGET=\"([^\"]*)\" ]] &&     
>     TGT="${BASH_REMATCH[1]}/`hostname -s`"
>   [[ "${Q}" =~ SOURCE=\"([^\"]*)\" ]] &&     
>     SRC="${BASH_REMATCH[1]}"    

>
> [ -n "$SRC" ] || continue
> [ -n "$TGT" ] || continue
> [ -d "$TGT" ] || continue
>
> # The actions to perform are then based on the source,
> # the label (if any) and any other criteria that can be
> # found with other options to findmnt.
> ...
> done
>
> I schedule the script that does. I use a custom run-crons
> (/usr/lib/cron/run-crons) but a script in /etc/cron.d would also be a
> good choice.
>
> Rather than dmesg, try
>
> alias lsblock='lsblk -o name,label,fstype,size,type,tran -x name'
>


--
Rod Rodolico
Daily Data, Inc.
POB 140465
Dallas TX 75214-0465 US
http://dailydata.net
214.827.2170