Using the Terminal to Backup Home Dir.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Using the Terminal to Backup Home Dir.
I really would like to get some experience using the Command Line, and this looks a good place to start. I have explored it on the web and not fond much Mostly Using the tar command, but I think I read somewhere that tar doesn't work well in Linux Mint. Is there there anybody out there that know how to do a backup using the Terminal?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: Using the Terminal to Backup Home Dir.
Have a look at
https://www.linux.com/learn/how-backup- ... mmand-line
rsync
.
Code: Select all
man rsync
Re: Using the Terminal to Backup Home Dir.
My preference is the mksquashfs command.
+ Needs no options at all to do the job.
+ Perfect since 2012.
+ Every live session Debian or Ubuntu or Mint etc etc keeps it perfect as new kernels are released... no squashfs... no live session.
sudo mksquashfs /home /media/mute/toshipod-e/2018-05-03-home.sfs
### Duplicate /home as a compressed read-only mountable file image.+ Needs no options at all to do the job.
+ Perfect since 2012.
+ Every live session Debian or Ubuntu or Mint etc etc keeps it perfect as new kernels are released... no squashfs... no live session.
Re: Using the Terminal to Backup Home Dir.
Copied your code into my terminal, and this was the response...Mute Ant wrote: ⤴Thu May 03, 2018 4:30 am My preference is the mksquashfs command.
sudo mksquashfs /home /media/mute/toshipod-e/2018-05-03-home.sfs
### Duplicate /home as a compressed read-only mountable file image.
+ Needs no options at all to do the job.
+ Perfect since 2012.
+ Every live session Debian or Ubuntu or Mint etc etc keeps it perfect as new kernels are released... no squashfs... no live session.
Code: Select all
sudo: mksquashfs: command not found
Re: Using the Terminal to Backup Home Dir.
More than what you asked for, but:
Here's a couple of pages worth reading... both are the same, but one has a few more details about hard links. It's basically what Timeshift does, but you'll maybe learn something useful in the process
Rsync Date Stamped, Snapshot Style, Incremental Backups
Time Machine for every Unix out there
Here's a couple of pages worth reading... both are the same, but one has a few more details about hard links. It's basically what Timeshift does, but you'll maybe learn something useful in the process
Rsync Date Stamped, Snapshot Style, Incremental Backups
Time Machine for every Unix out there
- catweazel
- Level 19
- Posts: 9763
- Joined: Fri Oct 12, 2012 9:44 pm
- Location: Australian Antarctic Territory
Re: Using the Terminal to Backup Home Dir.
Mute Ant wrote: ⤴Thu May 03, 2018 4:30 am My preference is the mksquashfs command.
sudo mksquashfs /home /media/mute/toshipod-e/2018-05-03-home.sfs
### Duplicate /home as a compressed read-only mountable file image.
+ Needs no options at all to do the job.
+ Perfect since 2012.
+ Every live session Debian or Ubuntu or Mint etc etc keeps it perfect as new kernels are released... no squashfs... no live session.
Parallel mksquashfs: Using 16 processors
Cool!
sudo mount -o loop /media/catweazel/HWRAID10-0/Working/Archives/2018-05-04-home.sfs /mnt -t squashfs
Brilliant! Too easy.
Thanks, it's really appreciated. You've saved me a lot of work when I start writing my backup program...
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
Re: Using the Terminal to Backup Home Dir.
The sudo ensures all the objects in /home can be duplicated, but it's hiding a helpful message...
mute@kermes ~ $
...that's just normal build-your-own-GNU... add the commands that a distribution has left out.
mute@kermes ~ $
mksquashfs
-----> The program 'mksquashfs' is currently not installed. You can install it by typing: sudo apt install squashfs-tools...that's just normal build-your-own-GNU... add the commands that a distribution has left out.
Re: Using the Terminal to Backup Home Dir.
Where does it put the "compressed read-only mountable file image"? Or what additional code would I use to mount it on a usb stick?Mute Ant wrote: ⤴Thu May 03, 2018 4:30 am My preference is the mksquashfs command.
sudo mksquashfs /home /media/mute/toshipod-e/2018-05-03-home.sfs
### Duplicate /home as a compressed read-only mountable file image.
+ Needs no options at all to do the job.
+ Perfect since 2012.
+ Every live session Debian or Ubuntu or Mint etc etc keeps it perfect as new kernels are released... no squashfs... no live session.
- catweazel
- Level 19
- Posts: 9763
- Joined: Fri Oct 12, 2012 9:44 pm
- Location: Australian Antarctic Territory
Re: Using the Terminal to Backup Home Dir.
/media/mute/toshipod-e/2018-05-03-home.sfs
Or what additional code would I use to mount it on a usb stick?
sudo mount -o loop /media/mute/toshipod-e/2018-05-03-home.sfs /mnt -t squashfs
It's in the posts up there. All you need do is read.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
Re: Using the Terminal to Backup Home Dir.
I should use the current date in the code? Correct?
Ok so once I got on the usb stick, what code do I use to get ot off the stick and installed on to 18.3.
I am not just going to copy and paste all this code, I want to know what I am doing and why, like what does "toshipod" do, and why it is followed by "-e".
On the other hand and after searching on line for a bit, I challenge anybody to tell me what "toshipod" does.
- catweazel
- Level 19
- Posts: 9763
- Joined: Fri Oct 12, 2012 9:44 pm
- Location: Australian Antarctic Territory
Re: Using the Terminal to Backup Home Dir.
chazb wrote: ⤴Fri Jun 22, 2018 3:09 pm I should use the current date in the code? Correct?
Ok so once I got on the usb stick, what code do I use to get ot off the stick and installed on to 18.3.
I am not just going to copy and paste all this code, I want to know what I am doing and why, like what does "toshipod" do, and why it is followed by "-e".
On the other hand and after searching on line for a bit, I challenge anybody to tell me what "toshipod" does.
/media/mute/toshipod-e/2018-05-03-home.sfs
is @Mute Ant's line based on their local machine. You need to modify it to suit your local machine's environment and your personal preferences. It's a unix path and file name. Simply copying it and pasting it into your machine will not work.If you look at @Mute Ant's instructions and my reply here, you will see that I modified the unix path for my local machine.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
Re: Using the Terminal to Backup Home Dir.
charles is the name of my computer, so it should look something like this?,,,,,,,,,,,catweazel wrote: ⤴Fri Jun 22, 2018 6:30 pmchazb wrote: ⤴Fri Jun 22, 2018 3:09 pm I should use the current date in the code? Correct?
Ok so once I got on the usb stick, what code do I use to get ot off the stick and installed on to 18.3.
I am not just going to copy and paste all this code, I want to know what I am doing and why, like what does "toshipod" do, and why it is followed by "-e".
On the other hand and after searching on line for a bit, I challenge anybody to tell me what "toshipod" does./media/mute/toshipod-e/2018-05-03-home.sfs
is @Mute Ant's line based on their local machine. You need to modify it to suit your local machine's environment and your personal preferences. It's a unix path and file name. Simply copying it and pasting it into your machine will not work.
If you look at @Mute Ant's instructions and my reply here, you will see that I modified the unix path for my local machine.
Code: Select all
sudo mksquashfs /home /media/charles/2018-06-23-home.sfs
Code: Select all
sudo mount -o loop /media/charles/2018-06-23-home.sfs /mnt -t squashfs
I notice you all use some options like -o, -e, -t etc. should I have an option after ,,,charles,,,?
- catweazel
- Level 19
- Posts: 9763
- Joined: Fri Oct 12, 2012 9:44 pm
- Location: Australian Antarctic Territory
Re: Using the Terminal to Backup Home Dir.
chazb wrote: ⤴Sat Jun 23, 2018 3:04 am charles is the name of my computer, so it should look something like this?,,,,,,,,,,,orCode: Select all
sudo mksquashfs /home /media/charles/2018-06-23-home.sfs
/home
is your home directory, the directory you want to backup.2018-06-23-home.sfs
is the name of the file you want to back up to./media/charles/
is the path to the file. That path must exist already, and because it's on another partition, it needs to be mounted.No. That is to mount the file so you can recover files from it.for puttting on a usb stick.Code: Select all
sudo mount -o loop /media/charles/2018-06-23-home.sfs /mnt -t squashfs
What I don't understand is, given you're struggling with command line syntax and unix paths, why you want to backup using the command line when there are enough GUI applications out there that will do the job reasonably well. Next to flying to wherever you live and typing in the correctly modified command for you, I don't know what else to tell you.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
Re: Using the Terminal to Backup Home Dir.
@catweazel
I might be mistaken, but wouldn't
just create the file in
I might be mistaken, but wouldn't
Code: Select all
sudo mksquashfs /home /media/charles/2018-06-23-home.sfs
/media/charles/
and not on the USB stick which seems to be the intention of the OP?Compare to:
Edit: Of course, if charles is the name of the medium mounted at /media, then it's alright, ...I guess
Re: Using the Terminal to Backup Home Dir.
Mute Ant wrote: ⤴Thu May 03, 2018 4:30 am My preference is the mksquashfs command.
sudo mksquashfs /home /media/mute/toshipod-e/2018-05-03-home.sfs
### Duplicate /home as a compressed read-only mountable file image.
+ Needs no options at all to do the job.
+ Perfect since 2012.
+ Every live session Debian or Ubuntu or Mint etc etc keeps it perfect as new kernels are released... no squashfs... no live session.
Neat !
Tried it out and it's working fine first time.
Thanks, Tony
Re: Using the Terminal to Backup Home Dir.
Please forgive me for picking your brain, your are right there are lots of GUI ways to do this. Though I learned a long time ago that if I am going to use a Linux OS I best learn how to use the Terminal. But now I am starting to realize that I may be into something that is a little over my head, or at least beyond me for the moment and is not so cut and dried as, copy and paste this to do that. Thank You for your input, you have been a great help, and I have learned much from you, not only in this thread but others as well.catweazel wrote: ⤴Sat Jun 23, 2018 4:06 am
What I don't understand is, given you're struggling with command line syntax and unix paths, why you want to backup using the command line when there are enough GUI applications out there that will do the job reasonably well. Next to flying to wherever you live and typing in the correctly modified command for you, I don't know what else to tell you.
- catweazel
- Level 19
- Posts: 9763
- Joined: Fri Oct 12, 2012 9:44 pm
- Location: Australian Antarctic Territory
Re: Using the Terminal to Backup Home Dir.
You're most welcome.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
Re: Using the Terminal to Backup Home Dir.
In the name of simplicity the thought occurred to me, forget this whole backup business, and just copy the Home folder to my usb stick, and then after I have installed LM 18.3, copy it back to 18.3's Home folder? But first deleting 18.3's Firefox.
- catweazel
- Level 19
- Posts: 9763
- Joined: Fri Oct 12, 2012 9:44 pm
- Location: Australian Antarctic Territory
Re: Using the Terminal to Backup Home Dir.
Just make sure you show hidden files before you do the copy, assuming you want to retain your settings.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
Re: Using the Terminal to Backup Home Dir.
I unhide all hidden files as a matter of course with in a day or to of installing any OS. In AA they say "Keep it simple, stupid", and that is what I am going to do.
Again Thank You.