LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-24-2024, 09:22 AM   #61
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,575

Original Poster
Blog Entries: 19

Rep: Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453

Quote:
Originally Posted by Turbocapitalist View Post
Is the target drive encrypted? I find that slows things way down. Depending on the brand/model of drive, encryption can slow it down by a factor of 10 or so.
No, I don't use encryption on either of my machines as they never leave the house. Besides, I would always be nervous of losing the encryption password!

It's probably slow because:
1) Littleboy is a very low spec machine.
2) The copy was done partly over wifi. I've tried to do it entirely via ethernet, but even when I used the address of the ethernet card on the laptop, it still used wifi for the transfer.

Most of today's update was the Mozilla cache, which imho is not worth copying. I must see if I can exclude that.
Quote:
This thread has encouraged some experimentation with these methods. On one project, I've moved to a rolling differential backup using Rsync and a --link-dest target based on the previous day.
Glad to have been of use.

Last edited by hazel; 02-24-2024 at 09:26 AM.
 
Old 04-13-2024, 04:00 AM   #62
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,310
Blog Entries: 3

Rep: Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722
I've revisited this one today. I think there is an approach which gives a week's worth of backups, while automatically allowing for missed days such as weekends or holidays. The date of the previous successful backup is recorded in the file system by touching the one directory and that date is later retrieved using stat with date via the UNIX epoch.

Code:
...
d1=$(date +"%u")
d2=$(date -d "@$(stat --format='%X' ./backup/)" +"%u")

set -e
rsync -avH --link-dest=./backup/${d2} -e '...' \
	far@away:/source/ ./backup/${d1}/

touch ./backup/
...
If multiple runs happen on the same day, the --link-dest option is basically a non-operation. I'm not sure what rsync does with it under the hood, but if it $d2 and $d1 are the same it is either ignored or pointing to the same and thus unchanged files. Either way, those files are not copied while any differences from the remote server are still processed.

The set -e is just a quick hack, there are probably more appropriate ways using the $? variable to deal with tracking whether the backup was successful and the directory's date refreshed.

If a year's worth of backups are needed then %j can be used instead of %u in the date calculation. Or else use %d for a month's worth of backups.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] best way to periodically rsync to clients from rsync server j1renicus Linux - General 2 09-19-2012 03:38 AM
[SOLVED] Advice needed setting up a MySQL server yariboy Linux - Newbie 7 04-07-2012 02:01 PM
Could I run rsync to download files from a server without rsync daemon? Richard.Yang Linux - Software 1 09-18-2009 04:08 AM
Rsync server vs rsync over ssh humbletech99 Linux - Networking 1 10-18-2006 12:10 PM
Advice needed on setting up security on Fedora installation gevers1 Linux - Security 1 01-21-2004 09:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration