Saturday, April 27, 2024
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 1591  / 1 Year ago, tue, february 28, 2023, 8:14:21

I want to backup my whole system. I am wondering if the dd command is a good choice for that.



dd if=/dev/sda of=/dev/sdb


For example: /dev/sda is my system partition (partition is on a ssd if that information is important) and /dev/sdb is my external usb hdd.
Is it possible to clone the whole system to a specific directory on my external hdd? Like this:



dd if=/dev/sda of=/dev/sdb/directory


I thought of the possibility to write my own backup-script, which makes a weekly backup of my system using the 'dd' command. Beyond that i want to encrypt my backup directory. What is a good choice for doing that? (I thought of EncFS for example).


More From » partitioning

 Answers
0

Another Solution:



Try running crontab -e and add something like the below: (see here for details)



#
# some comments are here
#
#

# rsync archive every day at midnight change /dev/null to a file name if you want to see the logs
0 0 * * * rsync –avu /path/to/source ~/rsync/daily > /dev/null

# rsync every sunday at 4am change /dev/null to a file name if you want to see the logs
0 4 * * 0 rsync –avu ~/rsync/daily ~/rsync/weekly > /dev/null

# rsync every 1st of the month use gzip to use less space change /dev/null to a file name if you want to see the logs
0 0 1 * * tar -cvzf ~/rsync/monthly/monthly_$(date +%m%d%Y).tar.gz ~/rsync/daily/


And to encrypt the folders you could do something like:



tar -cvz /path/to/directory | openssl des3 -salt > name_of_encrypted.tar.gz


And to decrypt:



cat name_of_encrypted.tar.gz | openssl des3 -d -salt | tar -xvz new_name_of_directory

[#26791] Wednesday, March 1, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tocklftime

Total Points: 110
Total Questions: 109
Total Answers: 100

Location: Mayotte
Member since Mon, Sep 12, 2022
2 Years ago
;