Backup question
Suvayu Ali
fatkasuvayu+linux at gmail.com
Wed Mar 19 08:20:32 UTC 2014
Hi,
On Wed, Mar 19, 2014 at 08:42:20AM +1100, Cameron Simpson wrote:
> On 16Mar2014 15:56, CS DBA <cs_dba at consistentstate.com> wrote:
> > where would I find a complete list of the completely dynamic top
> > level directories?
>
> You shouldn't care that they're top level, only which ones are the
> right type.
>
> Like this:
>
> mount | awk '$5 ~ /^(xfs|ext2|ext3)$/ { print $1 }'
>
> So in a script:
>
> mountpoints=$( mount | awk '$5 ~ /^(xfs|ext2|ext3)$/ { print $1 }' )
> for fs in $mount_points
> do
> ... backup "$fs", eg "rsync -x "$fs" ...
> done
>
> Expand the list of filesystem types with the ones you actually use;
> I tend to use xfs myself.
>
> You may want to explicitly avoid removable drives if they mount in
> a recognisably place. For example, I hand mount removable drives
> as /mnt/whatever, so I would avoid mount points starting with /mnt/
> to keep them from polluting my backup system.
I believe the recommended way to list filesystems (for many Fedoras) is
to use findmnt. This should be easy to use:
$ findmnt -l -o FSTYPE,TARGET | grep -E 'ext|ntfs|fat|xfs'
Hope this helps,
--
Suvayu
Open source is the future. It sets us free.
More information about the users
mailing list