Use dd or cp or rsync or tar for backing up files?

balenshah

Member
Joined
Aug 23, 2022
Messages
74
Reaction score
4
Credits
636
How do you determine it? Which one to use at which context?
I recently took backup using cp command. It was all good. But would there be a better way?
 


How do you determine it? Which one to use at which context?
I recently took backup using cp command. It was all good. But would there be a better way?
There are dozens of ways to backup your important data. It's up to you to try some out and see what meets your needs and is comfortable for you to use. Remember that no backup is any good unless it is tested! You have to restore your backups sometimes (or test the restore process) to have confidence in your recovery methods. "An untested backup is a wish, a hope, a prayer!" ;)

Myself... I don't want to backup the entire OS, so I don't use tools like Timeshift or cloning software (CloneZilla, Foxclone, etc). I don't even want to backup the entire /home folder as there is way too much there that I never need to restore. For me, these full backups are a waste of time and storage space... but many other folks prefer this method. You might too.

I use rsync (with --delete and -avhs options) in conjunction with an "exclude-file" that backs up only the files and folders in /home that I need. I have several rsync scripts that backup some specific things too, such as a custom backup of financial information to share regularly with my wife.

Also, rsync does incremental backups, so even my largest backup scripts are completely finished within a minute. I backup to 3 different SSD drives, plus my wife's USB flash drive, plus another special (encrypted) backup that I store online in case of fire or other disaster that might destroy all of the backup copies inside my home. It's not perfect, but it works for me (so far).

Good luck!
 
There are dozens of ways to backup your important data. It's up to you to try some out and see what meets your needs and is comfortable for you to use. Remember that no backup is any good unless it is tested! You have to restore your backups sometimes (or test the restore process) to have confidence in your recovery methods. "An untested backup is a wish, a hope, a prayer!" ;)

Myself... I don't want to backup the entire OS, so I don't use tools like Timeshift or cloning software (CloneZilla, Foxclone, etc). I don't even want to backup the entire /home folder as there is way too much there that I never need to restore. For me, these full backups are a waste of time and storage space... but many other folks prefer this method. You might too.

I use rsync (with --delete and -avhs options) in conjunction with an "exclude-file" that backs up only the files and folders in /home that I need. I have several rsync scripts that backup some specific things too, such as a custom backup of financial information to share regularly with my wife.

Also, rsync does incremental backups, so even my largest backup scripts are completely finished within a minute. I backup to 3 different SSD drives, plus my wife's USB flash drive, plus another special (encrypted) backup that I store online in case of fire or other disaster that might destroy all of the backup copies inside my home. It's not perfect, but it works for me (so far).

Good luck!
i see. sadly no rsync on servers we work.
 
Really? I thought rsync is included in all Linux distros! Are you sure?

Why include rsync in the title of your thread if it is not an option?
 
Hi, Balenshah, If you suddenly noticed a yellow or blue tinge on your monitor, it's unlikely that the issue is related to the monitor itself being burned out, especially if you've had no other problems with it for three years. There are a few potential reasons why you experienced this color distortion, and here are some suggestions to investigate and troubleshoot the issue

  1. Check cable connections: Ensure that all cables connecting your PC to the monitor are securely plugged in on both ends. Sometimes, loose or faulty connections can cause color distortions.
  2. Update graphics drivers: Outdated or incompatible graphics drivers can sometimes cause display issues. Visit the website of your graphics card manufacturer (e.g., NVIDIA, AMD, Intel) and download the latest drivers for your specific graphics card model. Install the updated drivers and see if the issue persists.
  3. Test on a different device: If possible, connect your monitor to another device, such as a laptop or another computer, and see if the color distortion issue occurs on that device as well. This can help determine if the problem is with the monitor or the PC.
  4. Adjust color settings: In addition to resetting your monitor to its default settings, you can also try adjusting the color settings manually. Most monitors have options to adjust brightness, contrast, color temperature, and color balance. Experiment with these settings to see if it helps resolve the color tinge issue.
  5. Check for environmental factors: Sometimes, external factors like nearby magnetic fields, excessive sunlight, or fluorescent lighting can interfere with your monitor's color reproduction. Make sure there are no strong magnetic sources (such as speakers) close to the monitor and consider adjusting the ambient lighting conditions to see if it improves the color accuracy.
  6. Perform a monitor self-test: Monitors often come with a built-in self-test feature that can help diagnose hardware issues. Refer to your monitor's user manual to find out how to perform a self-test. If the monitor exhibits color distortion during the self-test, it may indicate a hardware problem, and you should contact Dell support for further assistance.
If none of the above suggestions resolve the issue, it may be worth reaching out to Dell support directly, especially if your monitor is still under warranty. They can provide specific troubleshooting steps or advise on potential solutions based on your monitor model and the symptoms you're experiencing.
What's this have to do with backing up?
 
rsync is not for babies like me, I suppose. But tar is a great fuss to get it to do just what one wants it to do. I dislike its curt error messages. Must use it at the command line, something like Engrampa is just not a replacement if someone is picky about what to include in the archive because he/she doesn't have a lot of disk space to store backups.
 
If you have a large quantity of data - rsync is probably best, as it can do incremental backups, therefore saving some time - but against that you would want to do 'grandfather, father, son' types of backups, (i.e. keeping 3 separate backups).

Myself, as just a regular user, I just copy my own personal data to backup, usually keeping 2 or 3 copies on my backup drive, replacing the oldest with the newest.
 
i see. sadly no rsync on servers we work.
Really? I thought rsync is included in all Linux distros! Are you sure?

Why include rsync in the title of your thread if it is not an option?
That's because rsync isn't included in the "Minimal Installation" option for RHEL and neither is tar. You have to install them yourself, I find that quite odd that such tools aren't included in the minimal installation because they are both quite common used tools on a Linux system.
 
This "borg" is new to me.

Right now I'm on Q4OS v5.2 "Aquarius", based on Debian "Bookworm" and this is what I get. Therefore, I assume the other listing was from "pacman" on an Arch-based distro.

Code:
[~]$ apt search borg
Sorting... Done
Full Text Search... Done
backupninja/stable,stable 1.2.2-1 all
  lightweight, extensible meta-backup system

borgbackup/stable 1.2.4-1 amd64
  deduplicating and compressing backup program

borgbackup-doc/stable,stable 1.2.4-1 all
  deduplicating and compressing backup program (documentation)

borgbackup-is-borgbackup2/stable 2.0.0b5-1 amd64
  deduplicating and compressing backup program (unversioned symlink)

borgbackup2/stable 2.0.0b5-1 amd64
  deduplicating and compressing backup program (version 2.x)

borgbackup2-doc/stable,stable 2.0.0b5-1 all
  deduplicating and compressing backup program (documentation for version 2.x)

borgmatic/stable,stable 1.7.7-1 all
  automatically create, prune and verify backups with borgbackup
(more)
 
Therefore, I assume the other listing was from "pacman" on an Arch-based distro.
My output was from my desktop which runs Arch but it is available in the repo of most other distributions as well.
 
dd - is a bit for bit copier. Make sure your destination hard drive is a least as big as the source.

cp -R * will work, the advantage is.. it only uses as much room as the binaries take up.

rsync is typically used for remote backups over the network. You can do the same thing with
a mounted remote drive and cp. The advantage to using rsync is, I don't have to keep my disk mounted
all the time.

tar ( tape archiver ) is similar to using cp, in that it only takes up as much as the binaries take up.
One big advantage of tar, is that it puts the files back in the same directory structure, with the same permissions as the original.

There are other options. But 3 of the 4 you have listed here only work on your local file system.
That means if you lose your local disk, you lose your backups as well.

You can use dd, tar, and cp to copy files to a remote mounted drive, or else create the backups locally
and then, scp or ftp them to the remote backup system. Depending on how big these files hour, this
can take a very long time ( in some cases hours ).
 

Members online


Latest posts

Top