Welcome! » Log In » Create A New Profile

Question about mv and cp folder rotation

Posted by Anonymous 
Question about mv and cp folder rotation
May 26, 2016 04:47AM
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] /opt/bin/rm -rf /mnt/pme-nas2/Backups/daily.6/
[2016-05-26T05] mv /mnt/pme-nas2/Backups/daily.5/ /mnt/pme-nas2/Backups/daily.6/
[2016-05-26T05] mv /mnt/pme-nas2/Backups/daily.4/ /mnt/pme-nas2/Backups/daily.5/
[2016-05-26T05] mv /mnt/pme-nas2/Backups/daily.3/ /mnt/pme-nas2/Backups/daily.4/
[2016-05-26T05] mv /mnt/pme-nas2/Backups/daily.2/ /mnt/pme-nas2/Backups/daily.3/
[2016-05-26T05] mv /mnt/pme-nas2/Backups/daily.1/ /mnt/pme-nas2/Backups/daily.2/
[2016-05-26T05] /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.
Question about mv and cp folder rotation
May 26, 2016 04:58AM
On 26 May 2016 at 12:45, Phill Edwards <philledwards < at > gmail.com ([email]philledwards < at > gmail.com[/email])> wrote:
[quote]I have rsnapshot set up to run daily, weekly and monthly backups. It&#39;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] /opt/bin/rm -rf /mnt/pme-nas2/Backups/daily.6/
[2016-05-26T05] mv /mnt/pme-nas2/Backups/daily.5/ /mnt/pme-nas2/Backups/daily.6/
[2016-05-26T05] mv /mnt/pme-nas2/Backups/daily.4/ /mnt/pme-nas2/Backups/daily.5/
[2016-05-26T05] mv /mnt/pme-nas2/Backups/daily.3/ /mnt/pme-nas2/Backups/daily.4/
[2016-05-26T05] mv /mnt/pme-nas2/Backups/daily.2/ /mnt/pme-nas2/Backups/daily.3/
[2016-05-26T05] mv /mnt/pme-nas2/Backups/daily.1/ /mnt/pme-nas2/Backups/daily.2/
[2016-05-26T05] /opt/bin/cp -al /mnt/pme-nas2/Backups/daily.0 /mnt/pme-nas2/Backups/daily.1

Why doesn&#39;t daily.0 mv to daily.1? Sorry if this is a bleedin&#39; obvious logic question, but I just don&#39;t get it at the moment.

[/quote]

AFAIK it&#39;s because it needs to create new hard links to the existing files.

poc
Question about mv and cp folder rotation
May 26, 2016 05:59AM
Phill Edwards wrote on 26.05.2016 at 13:45:
[quote][...]
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.

[/quote]
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

------------------------------------------------------------------------------
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
rsnapshot-discuss < at > lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rsnapshot-discuss
Question about mv and cp folder rotation
May 26, 2016 08:12AM
It copies daily.0 to daily.1, then rsync updates daily.0

On 05/26/2016 06:45 AM, Phill Edwards wrote:

[quote] 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] /opt/bin/rm -rf /mnt/pme-nas2/Backups/daily.6/
[2016-05-26T05] mv /mnt/pme-nas2/Backups/daily.5/ /mnt/pme-nas2/Backups/daily.6/
[2016-05-26T05] mv /mnt/pme-nas2/Backups/daily.4/ /mnt/pme-nas2/Backups/daily.5/
[2016-05-26T05] mv /mnt/pme-nas2/Backups/daily.3/ /mnt/pme-nas2/Backups/daily.4/
[2016-05-26T05] mv /mnt/pme-nas2/Backups/daily.2/ /mnt/pme-nas2/Backups/daily.3/
[2016-05-26T05] mv /mnt/pme-nas2/Backups/daily.1/ /mnt/pme-nas2/Backups/daily.2/
[2016-05-26T05] /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.

[quote]------------------------------------------------------------------------------
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!
[url=https://ad.doubleclick.net/ddm/clk/304595813;131938128;j]https://ad.doubleclick.net/ddm/clk/304595813;131938128;j[/url][/quote]

[quote]_______________________________________________
rsnapshot-discuss mailing list
rsnapshot-discuss < at > lists.sourceforge.net ([email]rsnapshot-discuss < at > lists.sourceforge.net[/email])
[url=https://lists.sourceforge.net/lists/listinfo/rsnapshot-discuss]https://lists.sourceforge.net/lists/listinfo/rsnapshot-discuss[/url]
[/quote] [/quote]
Sorry, only registered users may post in this forum.

Click here to login