Discussion:
[rsnapshot-discuss] Question about mv and cp folder rotation
Phill Edwards
2016-05-26 11:45:11 UTC
Permalink
I have rsnapshot set up to run daily, weekly and monthly backups. It's
working a treat, though I would like it to complete a bit quicker. One of
the longest steps is copying daily.0 to daily.1 As the log extract shows
below, nearly all of the initial folder shuffling is done with mv commands
which is very quick. But the generation of daily.1 is done by cp from
daily.0 which is slow.

[2016-05-26T05:10:08] /opt/bin/rm -rf /mnt/pme-nas2/Backups/daily.6/
[2016-05-26T05:20:53] mv /mnt/pme-nas2/Backups/daily.5/
/mnt/pme-nas2/Backups/daily.6/
[2016-05-26T05:20:53] mv /mnt/pme-nas2/Backups/daily.4/
/mnt/pme-nas2/Backups/daily.5/
[2016-05-26T05:20:53] mv /mnt/pme-nas2/Backups/daily.3/
/mnt/pme-nas2/Backups/daily.4/
[2016-05-26T05:20:53] mv /mnt/pme-nas2/Backups/daily.2/
/mnt/pme-nas2/Backups/daily.3/
[2016-05-26T05:20:53] mv /mnt/pme-nas2/Backups/daily.1/
/mnt/pme-nas2/Backups/daily.2/
[2016-05-26T05:20:53] /opt/bin/cp -al /mnt/pme-nas2/Backups/daily.0
/mnt/pme-nas2/Backups/daily.1


Why doesn't daily.0 mv to daily.1? Sorry if this is a bleedin' obvious
logic question, but I just don't get it at the moment.
Patrick O'Callaghan
2016-05-26 11:55:56 UTC
Permalink
Post by Phill Edwards
I have rsnapshot set up to run daily, weekly and monthly backups. It's
working a treat, though I would like it to complete a bit quicker. One of
the longest steps is copying daily.0 to daily.1 As the log extract shows
below, nearly all of the initial folder shuffling is done with mv commands
which is very quick. But the generation of daily.1 is done by cp from
daily.0 which is slow.
[2016-05-26T05:10:08] /opt/bin/rm -rf /mnt/pme-nas2/Backups/daily.6/
[2016-05-26T05:20:53] mv /mnt/pme-nas2/Backups/daily.5/
/mnt/pme-nas2/Backups/daily.6/
[2016-05-26T05:20:53] mv /mnt/pme-nas2/Backups/daily.4/
/mnt/pme-nas2/Backups/daily.5/
[2016-05-26T05:20:53] mv /mnt/pme-nas2/Backups/daily.3/
/mnt/pme-nas2/Backups/daily.4/
[2016-05-26T05:20:53] mv /mnt/pme-nas2/Backups/daily.2/
/mnt/pme-nas2/Backups/daily.3/
[2016-05-26T05:20:53] mv /mnt/pme-nas2/Backups/daily.1/
/mnt/pme-nas2/Backups/daily.2/
[2016-05-26T05:20:53] /opt/bin/cp -al /mnt/pme-nas2/Backups/daily.0
/mnt/pme-nas2/Backups/daily.1
Why doesn't daily.0 mv to daily.1? Sorry if this is a bleedin' obvious
logic question, but I just don't get it at the moment.
AFAIK it's because it needs to create new hard links to the existing files.

poc
Clemens Feige
2016-05-26 12:44:06 UTC
Permalink
Post by Phill Edwards
[...]
Why doesn't daily.0 mv to daily.1? Sorry if this is a bleedin' obvious
logic question, but I just don't get it at the moment.
Hi Phill

The daily.0 is moved to daily.1. Then a new daily.0 is created as a
hard-linked copy of daily.1 (former daily.0). Next the RSYNC step will
synchronize the daily.0 with recent changes from the backup source. Now
daily.0 will be different from daily.1 then (assuming that backup data
has changed somehow).

Clemens
James Nelson
2016-05-26 14:56:54 UTC
Permalink
It copies daily.0 to daily.1, then rsync updates daily.0
Post by Phill Edwards
I have rsnapshot set up to run daily, weekly and monthly backups. It's
working a treat, though I would like it to complete a bit quicker. One
of the longest steps is copying daily.0 to daily.1 As the log extract
shows below, nearly all of the initial folder shuffling is done with
mv commands which is very quick. But the generation of daily.1 is done
by cp from daily.0 which is slow.
[2016-05-26T05:10:08] /opt/bin/rm -rf /mnt/pme-nas2/Backups/daily.6/
[2016-05-26T05:20:53] mv /mnt/pme-nas2/Backups/daily.5/
/mnt/pme-nas2/Backups/daily.6/
[2016-05-26T05:20:53] mv /mnt/pme-nas2/Backups/daily.4/
/mnt/pme-nas2/Backups/daily.5/
[2016-05-26T05:20:53] mv /mnt/pme-nas2/Backups/daily.3/
/mnt/pme-nas2/Backups/daily.4/
[2016-05-26T05:20:53] mv /mnt/pme-nas2/Backups/daily.2/
/mnt/pme-nas2/Backups/daily.3/
[2016-05-26T05:20:53] mv /mnt/pme-nas2/Backups/daily.1/
/mnt/pme-nas2/Backups/daily.2/
[2016-05-26T05:20:53] /opt/bin/cp -al /mnt/pme-nas2/Backups/daily.0
/mnt/pme-nas2/Backups/daily.1
Why doesn't daily.0 mv to daily.1? Sorry if this is a bleedin' obvious
logic question, but I just don't get it at the moment.
------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
rsnapshot-discuss mailing list
https://lists.sourceforge.net/lists/listinfo/rsnapshot-discuss
Loading...