Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Which folders to back up in Linux?


  • Please log in to reply
6 replies to this topic

#1 BlueGalaxy

BlueGalaxy

  • Members
  • 83 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:06:00 AM

Posted 10 August 2017 - 09:41 PM

Hello. I would like to backup my data for Ubuntu 16.04, and not only my user files. I've installed a pretty good amount of software from both the terminal and Ubuntu Software center. I remember installing git, cmatrix, terminator, conky, and some other packages, but I can't remember which ones exactly. Also I changed some configuration files for my programs, such as .bashrc, both for the default programs, and new ones that I installed. I would like to save all my programs and settings that I changed after setting up the OS for the first time, to a USB storage device. That way, if I would ever have to do a re-install of the OS, I could just copy those files in.

 

Now I'm thinking about where those program files and configuration files could be. My / directory has the following sub-directories:

bin    dev   initrd.img      lib64       mnt   root  snap  tmp  vmlinuz
boot   etc   initrd.img.old  lost+found  opt   run   srv   usr  vmlinuz.old
cdrom  home  lib             media       proc  sbin  sys   var

Which of these folders should I copy over to backup my system programs, files, and settings? I think that bin should be included in the list, because it has all the commands for the OS, and I installed some new ones, so they may have been added to bin. The folder etc should also be included, because it contains the configuration files. Other folders that I would copy over are home, lib, lib64, opt, usr. Are those folders sufficient enough for a backup? If for example, I would reinstall the OS, if I would restore the copied folders, would that return the Linux system to its desired state?


Edited by BlueGalaxy, 10 August 2017 - 09:42 PM.


BC AdBot (Login to Remove)

 


#2 Gary R

Gary R

    MRU Admin


  • Malware Response Team
  • 801 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:01:00 PM

Posted 11 August 2017 - 12:33 AM

Rather than having to do that, you could just use something like Aptik which many of us use to backup our Linux machines.

 

http://www.teejeetech.in/2014/01/introducing-aptik.html



#3 mremski

mremski

  • Members
  • 493 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:NH
  • Local time:08:00 AM

Posted 11 August 2017 - 05:20 AM

programs can always be reinstalled, especially if you are reinstalling the OS.

User Data is what is key.

I personally use a separate device, not just a separate partition, for my /home.  That means I can easily upgrade the OS without losing my data.

/etc is going to have overall system configuration to save.

Any program specific configuration changes are likely stored under your home directory, except for something you did to change "global" configuration.  The location for that would be application specific.

You can easily tar up things like /etc into a file in your home directory, leaving you only the home directory to back up.


FreeBSD since 3.3, only time I touch Windows is to fix my wife's computer


#4 Rocky Bennett

Rocky Bennett

  • Members
  • 2,590 posts
  • ONLINE
  •  
  • Gender:Male
  • Location:New Mexico, USA
  • Local time:06:00 AM

Posted 11 August 2017 - 12:08 PM

programs can always be reinstalled, especially if you are reinstalling the OS.

User Data is what is key.

I personally use a separate device, not just a separate partition, for my /home.  That means I can easily upgrade the OS without losing my data.

/etc is going to have overall system configuration to save.

Any program specific configuration changes are likely stored under your home directory, except for something you did to change "global" configuration.  The location for that would be application specific.

You can easily tar up things like /etc into a file in your home directory, leaving you only the home directory to back up.

 

 

I agree 100%. Do not worry about backing up any programs. Back up all of your personal data, religiously. Make as many copies as you can afford. I myself have 4 copies of my personal data, but when I get more money I will create another copy.

 

And back up

back up

back up

 

Not just once but regularly. I have 12 terabytes of data so I can only tackle the project about twice a year, but do it as often as you can.

 

This is the 21st century, you need to

back up

back up

back up


594965_zpsp5exvyzm.png


#5 NickAu

NickAu

    Bleepin' Fish Doctor


  • Moderator
  • 12,866 posts
  • ONLINE
  •  
  • Gender:Male
  • Location:127.0.0.1 Australia
  • Local time:10:00 PM

Posted 11 August 2017 - 09:53 PM

I only back up my home folder if needed I prefer a clean install..

 

This is my back up.

 

sudo ufw enable && sudo apt-get install synaptic && sudo apt-get install gnome-system-tools && sudo apt-get install gufw && sudo apt-get install transmageddon && sudo apt-get install acetoneiso && sudo apt-get install k3b && sudo apt-get install htop sysinfo hardinfo && sudo apt-get install shutter && sudo apt-get install inkscape && sudo apt-get install photofilmstrip && sudo apt-get install smplayer && sudo apt-get install vlc && sudo apt-get install libdvdread4 && sudo /usr/share/doc/libdvdread4/install-css.sh && sudo add-apt-repository ppa:tualatrix/ppa && sudo apt-get update && sudo apt-get install ubuntu-tweak && sudo apt-get install ttf-mscorefonts-installer && sudo apt-get install pinta && sudo apt-get install shotwell && sudo apt-get install darktable && sudo apt-get install photofilmstrip && sudo apt-get install gimp gimp-data gimp-data-extras gimp-gap gimp-plugin-registry libtiff-tools gimp-help-en icc-profiles glew-utils gimp-help-common gmic gimp-gmic gmic-zart libtiff-opengl && sudo apt-get install rawtherapee libraw-bin ufraw ufraw-batch && sudo apt-get install audacious && sudo apt-get install ubuntu-restricted-extras && sudo apt-get install macchanger && sudo apt-get install aircrack-ng && sudo reboot

After I install the OS I just run that in terminal and bingo my PC is back the way it was.

 

I also use xmarks plug in on my browser so book marks are backed up.



#6 Rocky Bennett

Rocky Bennett

  • Members
  • 2,590 posts
  • ONLINE
  •  
  • Gender:Male
  • Location:New Mexico, USA
  • Local time:06:00 AM

Posted 12 August 2017 - 06:34 AM

Well there you go. Back ups are like religion, everybody has their own opinion.

 

To the OP, if you have been around Windows for more than a year or two then keep on practicing your back ups the same way with Linux. If you are new to computers altogether, then there is a lot to learn about back ups.


594965_zpsp5exvyzm.png


#7 rufwoof

rufwoof

  • Members
  • 110 posts
  • OFFLINE
  •  
  • Local time:01:00 PM

Posted 21 August 2017 - 05:48 PM

With the contents of /boot, /etc and /home you'll have most of the configuration and data files that would aid in 'reinstalling afresh'. I like to have multi-boots and use one to backup another using mksquashfs (squashfs-tools) that creates a single compressed filesystem file of a partition. And then I copy those files to removable secondary backups. As my systems tend to be relatively small its quick and easy for me to backup the entire partition (system, configuration and data).

 

Something like ...

 

for backup ...

 

cd /mnt

mkdir sda1

mount /dev/sda1 sda1

mksquashfs /mnt/sda1 backup.sfs

 

for restore ...

 

cd /mnt

mkdir sda1

mount /dev/sda1 sda1

unsquashfs -f -d /mnt/sda1 backup.sfs


Edited by rufwoof, 21 August 2017 - 05:49 PM.

Debian and OpenBSD multiboot's





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users