Using the CLI to backup or copy a Linux system

Ernie, you might want to check your PC specs. My laptop came with only a .5 TB also. But it had a second M.2 slot. So now my PC now has 1.5 TB total space. Win 11 on one SSD and Mint on the other.

4 Likes

Mine does too, but I’ll have to wait until I can muster the cost. was recently admitted to my local hospital, and diagnosed with Congestive Heart Failure (CHF), and they had to get over thirty pounds (US) of water out of my system. I’m doing much better now, and I’m back home, but on a low-salt diet. After I got home, there was a lot I needed to manage my newly diagnosed condition that was not covered by insurance, and I went into debt a bit over $#00.00 (US), and it’ll take me a few months to catch up. Social Security is my sole source of income, so there’s not a lot of room for new essentials, but I’ll get by, bit-by-bit :slight_smile:

Ernie

4 Likes

Hi Ernie,
Sorry to hear you are having health issues.
The important thing is to follow the doctor’s instructions… no short cuts, do everything they say.
Forget the backups for now… your health is more important.
Regards
Neville

3 Likes

Glad to read you are doing better.

I am not home now but will be in a couple days. I believe I have a 1TB or 1.5 TB external 2.5 inch USB HDD in a case that you can have. No external power, runs off the USB power.

Send private message, if you are interested.

5 Likes

Not a chance! These adventures are all that keep me sane these days! I do my exercises daily - all of them, and I’m taking all my prescribed medication as scheduled - my pharmacy packages everything in monthly mailings, complete with the packet roll in a box pill organizing system - broken down into mornings, evenings, and bedtime! My son does most of the cooking, and he’s been working hard to eradicate any salt he can from our diet - he shares my required as-salt-free-as-possible diet, so I have a lot of time on my hands, so experimental adventures help me to fill that time, preventing me from becoming bored. I really need it, but I never allow it to prevent me from taking care of business, regarding my health and well being! I promise! Believe me, I know how serious all this is! If I had waited another day or so to get help, I might not be here now, so, believe me, I’m taking everything as seriously as I can, without diving into fear. My belief is that if I do everything I’m supposed to do, and take things as they come, just like I always do (to avoid panic & fear), then what comes will come, and my future will then be out of my hands. Like the lyrics of that classic song ā€œKay Sarah Sarahā€ says, ā€œWhat will be will beā€

Ernie

5 Likes

Sorry to read your illness, and glad you are doing somewhat better now.
Get well completely as soon as possible!
So the wrinting below is not for you, go figure yourself! :wink:
Just kidding, of coure you can read it.
:smiley:

Consumes waaaay much less disk space.
Say, we have a directory full of evereything, about 1TB in size.
Now to do a backup of this dir, invoke rsync:

rsync -av the-big-data-dir/ the-backup-path-0/
I use here relative paths, this is important for link-dest later.

Now assume, some files were added, some deleted, but not too much, and want another backup in the-backup-path-1.

Running rsync as above:
rsync -av the-big-data-dir/ the-backup-path-1/

would create another 1TB backup plus the new files (of course minus the deleted files) as it will copy all exisitng files again.
But!!!
rsync -av the-big-data-dir/ the-backup-path-1/ --link-dest=../the-backup-path-0
will copy only the new files into backup-path-1, while the unchanged files will not be copied again, instead, replaced with a hard link pointing to the original backup-path-0.
The deleted files simply will not be copied to the new backup dir.
If you cd to backup-path-1, and do an ls command, you will find all the files there currently in the original dir. Backup-path-0 will still contain the files already deleted from the original…
I can say, the files unchanged between initial backup, and the backup done later exist now 2 times, both in backup-path-1 and backup-path-0, the files deleted meanwhile exist only in backup-path-0. However, because of hard links, on the disk they consume the space only once. Hard links consume very few space.
So after all, backup-path-1 is an incremental backup of the original based on backup-path-0.

Does this make it more clear?

3 Likes

Take good care of yourself. Your health is so important.

Good advice but very difficult to follow as almost every product contains so much. Bread, cerials canned food almost all processed items. My wife has been looking at this for her own health regarding cholestƩrol rƩduction and changing my diet to suit and i dont have issues.

Yes , very clear, thank you. Now that I can see what the links do, I am less afraid of them
You are mimicing what Timshift does.

What I am interested in is , say I do

rsync -av the-big-data-dir/ the-backup-path-0/

and get my first backup.
Then when I want to backup again I do

rsync -av  --delete the-big-data-dir/ the-backup-path-0/

ie overwrite the original backup with incrementals
then

  • it will be fast
  • it will not consume any extra space ( just the increments)
    but
    one can only recover the current state, not a specific date.

I think for user data, that may be the way to go. For system backups, one might need to be able to roll back, so your timeshift imitation would be the way to go.

Dont forget… we have said that -av is not adequate.
Should be -avxHAXS with the -x optional.

What do you imagine a hard link would do with a file that was a soft link?

I am gearing up to do some testing … I want to see some of these things work with a real backup and restore.

4 Likes

My father lost a kidney and had to have a salt free diet. We grew up with no salt on the table , and salt not used in cooking. Processed food hardly existed in 1950’s so it was not an issue.
I think my sister and I benefited from the enforced salt free upbringing… we both have low blood pressure and no cardiac issues ( touch wood).
Even today, my wife smothers everything with salt and pepper, but I have nil. At my request she cooks without salt.
I cant stand the taste.

4 Likes

Yes of course, but this won’t track deletions. Assuming you delete something from the original for a reason, it still will be there in the backup.

1 Like

Will not --delete remove deleted files from the backup?

So if I mistakedly delete a file, then do not realise before I run the backup, it is unrecoverable.

Other than that, it should manage deleted files OK.

At the moment , for data only, what I have been doing is repeatedly rsync to the same filesystem, without --delete … so I have an archive, rather than a backup. That could get untidy if I were forced to use it for a full recovery.

2 Likes

My mother was the same both in cooking and at the table

We now never use it but have a stock for visitors

2 Likes

I don’t expect to ā€œget completely betterā€ because there’s no real ā€˜cure’ for CHF, but my heart’s getting a bit stronger, at least as far as I can tell, I’m slowly losing weight, not gaining, so I’m no longer holding water in my body (I lost 30 to 40 pounds (US) of water (I don’t know how many gallons that is) while in the hospital, and I weighed in at about 300 Lbs. when I was released, and now I at about 280, so as I said, I’m still improving. I’m very cautious about what I eat, as little salt as possible (no added salt at all, or any food with added salt (enriched, or improved packaged foods for the most part), and I’m careful about the amount of sweets I consume too.

I don’t remember much about my time in the Medical Hospital, but I do know that when I arrived at the ER, they diagnosed me as having CHF (Congestive Heart Failure), and they put me on a fairly aggressive Lasix drip, and they also said that my heart was fluttering, with a bit of aortal fibrillation, so after they got the water content in my body under control, they tried to shock my heart back into sinus rhythm, and that worked for about a minute, so some time later, they performed an operation on my heart, called an ablation to ā€˜burn out’ the short circuiting whatever they[re called (Nodes??) that were responsible for my heart rate/rhythm issues, on the right side of my heart, cautioning me that they may have to do the same at some point in the future on the left side. When I was discharged from there, I went to a local, and excellent Physical Therapy Hospital, and they worked wonders for me. When I arrived I could barely walk 14 feet using a walker. When I was discharged two weeks later, I was walking well over 200 feet, still using that walker, but mostly for safety rather than need. From there, I had to go to a Physical Therapy Nursing Home for about a week before I was allowed to come home, but I’ve been here ever since, and I’m really glad! :slight_smile:

I’m hoping to get my weight down to about 200 Lbs. or so, but I’ll take 225 if I can get there, but I expect it to take a few years for that, but that’s my goal!

Ernie

5 Likes

I am! I promise! :slight_smile:

Ernie

1 Like

While I still eat some bread, we’re trying to bake our own bread here, using those varieties of flour that aren’t enriched, and we cook with fresh meats (nothing processed or salted like hams, etc.), whole potatoes, fresh vegetables when we can get then, frozen when we can’t, and there’s a variety of rice that’s not salted or bleached (not the one called brown rice, but something similar looking) that we use in our cooking, oh, and we use bagged beans now, nothing canned!

Ernie

2 Likes

I like to backup my important files from the cloud to a local disk every couple of days.
Then using;
rsync -rah --delete /media/easyt/LM-Bkup/Cloud-1 /home/easyt/Dropbox

I update Dropbox (not copy) so at the end of the procedure, I have 3 copies of the directory. I check Dropbox and it is an exact duplicate of the copied file.

3 Likes

Good luck on your path of loosing weight. It can be difficult, but sounds like you are on a good path.

I heard a gallon of water weighs 10 pounds, but checking the web, it said the weight is close to 8.25 pounds for a gallon of water.

2 Likes

Does it still dƩpend on height for BMI or is that old hat now

But now i read about keep your waist measurement to half your height. As a better measure.

To be honest, I don’t really pay any attention to any of those measures. All I do is remain as active as I can while challenging my mind, so both my body and mental acuity remain as healthy as possible. I only eat when I’m hungry, and I stop eating when I’m no longer hungry, so I don’t eat until I’m full. Hopefully, I’ll continue losing weight, albeit slowly, due to these changes I’ve introduced to my lifestyle since returning home from the hospital.

Ernie

3 Likes