On 20/12/2025 12:00, [email protected] wrote:
Send dorset mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        https://mailman.lug.org.uk/mailman/listinfo/dorset
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of dorset digest..."


Today's Topics:

    1. Re: For backup I use rsync onto a USB attached drive, > - but
       sometimes it writes to the root filesystem! (John D)


----------------------------------------------------------------------

Message: 1
Date: Fri, 19 Dec 2025 17:14:23 +0000
From: John D <[email protected]>
To: [email protected]
Subject: Re: [Dorset] For backup I use rsync onto a USB attached
        drive, > - but sometimes it writes to the root filesystem!
Message-ID:
        
<vi0p189mb351800482e0c740392458a58a2...@vi0p189mb3518.eurp189.prod.outlook.com>
        
Content-Type: text/plain; charset=UTF-8; format=flowed



----------------------------------------------------------------------

------------------------------

Message: 2
Date: Tue, 16 Dec 2025 15:27:26 +0000
From: Ralph Corderoy <[email protected]>
To: John D <[email protected]>
Cc: [email protected]
Subject: Re: [Dorset] For backup I use rsync onto a USB attached drive
        - but sometimes it writes to the root filesystem!
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8

Hi John,

I have a drive with 2 main partitions; I plug it into a USB port and
run a script that chooses one of the partitions (using a "last
touched" test on a dummy file).

Does the script mount the chosen partition?  Or could the script be
running the rsync before something else has mounted it?

No.  Ubuntu automounts removable drives.  I'll try disabling this.
That can be done with gsettings, but I discovered something I didn't expect when trying it out. If I execute: rsync -zriv --progress --ignore-existing /home/shareddocs/Photos "/media/john/PHOTOS" which is a line from my backup job, then it runs successfully even when there is NOT a disk plugged in. The "mount point" /media/john/PHOTOS is created in the root filesystem and off it goes!

Following up Ralph's suggestion that the device could be suffering I found on the net several examples of WD Passport disks doing just that and that is the model I have.

So, my hypothesis is that during a backup run the disk sometimes drops out and, immediately, a path is created on the root filesystem and the job continues.

To overcome that I seem to need a control job that observes what is happening and aborts the copying when needed. This is my crude and incomplete attempt:

Backup-control
let size=`df /|sed 1d| awk '{print $3}'|sed s/G//` #Read and save filesystem size from "df /"
let limit=size+size/10  #Calculate a limit, e.g. size + 10%
let mypid=`Backup-rsync&`   #start copying job, but this doesn't work,
                        #so how can I save the pid?
until
        `df /|sed 1d| awk '{print $3}'|sed s/G//` > $limit
        or
        ??? #saved pid does not exist
do
done
if ??? #saved mypid exists
then
        kill mypid
        echo "bad backup"
fi

I expect that observing for disk problems using dmesg would be better. I'll look into that later.




--
 Next meeting: Online, Jitsi, Tuesday, 2026-01-06 20:00
 Check to whom you are replying
 Meetings, mailing list, IRC, ...  https://dorset.lug.org.uk
 New thread, don't hijack:  mailto:[email protected]

Reply via email to