[lug] quick bash mount and rmt questions

Dan Mackin dan.mackin at gmail.com
Tue Oct 15 10:52:21 MDT 2019


I like this solution:

if grep -qs '/mnt/backups ' /proc/mounts; then
    # Mounted, do backup stuff.
else
    # Not mounted, print error and exit.
fi

On Tue, Oct 15, 2019 at 8:04 AM Bear Giles <bgiles at coyotesong.com> wrote:

> A few quick questions since I've been reviewing my backup scripts...
>
> 1. Is there a way for my bash script to be conditional on whether a disk
> is mounted? It's partly security (only mount disks when required), partly
> to ensure that I don't exhaust my disk space since I didn't notice the NFS
> /backups directory wasn't mounted. I know I could create a sentinel file
> that's only present in the mounted partition (or vice versa) and do a test
> for existence but is there another way using the mount subsystem?
>
> 2. Are there 'rmt' apps that write to disk instead of tape? It might to do
> some deep packet inspection to extract the 'label' from the data stream.
> It's fine if it's write-only.
>
> ... or I might just (finally) write a simple webapp and client. I want to
> create standard files - .tar or .zip - but want the backup tool to be
> write-only and append-only. I can retrieve the file directly if I need to
> do a restore the partition. That avoids the problem of malware that walks
> the filesystem and deletes or encrypts everything - including backup media.
> I can easily create .tar or .zip files, encrypt them, and even upload them
> to S3. The client would only need to be able to walk the filesystem and
> make simple REST calls to the server.
>
> Bear
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> Join us on IRC: irc.hackingsociety.org port=6667 channel=#hackingsociety
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lug.boulder.co.us/pipermail/lug/attachments/20191015/06e2bd7e/attachment-0001.html>


More information about the LUG mailing list