Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm quite new to Ubuntu and want to create a backup. I'm really not sure what files and folders to include so that if I restore my system it will be as it is now. I can't seem to find good details of this anywhere. Hopefully someone could help me with this. Is it possible to backup everything as it is now so in the event of a system restore I don't have to reinstall programs and settings?

Thanks, Jason

share|improve this question

My backup sets currently contain

/var (except /var/run, /var/cache, /var/tmp)
/usr (/usr/local only, nothing else)

Note this is for a server, so backing up things like /etc saves all my configuration for my services, I have web servers in /srv (though if you have them in /var/www, they would still be in this backup set), I have various scripts and things set up in /usr/local, etc. Backing up /home instead of /home/myusername is so that I can preserve all users. If all you want to keep is your user data, you only need your home directory.

share|improve this answer

Most people just backup their home directory: /home/$USER/. If you want to back up the configuration files and settings, those are stored in folders and files in your home directory that start with a . (dot). Make a list of packages that you use (and PPAs) and it will be easy to reinstall all your packages should you need. Or, use the command described in this comment.

Deja Dup Backup is a great tool that comes as a default on Ubuntu. Other options include command line (rsync, rsnapshot, rdiff-backup, etc).

Finally, to backup the whole disk as an image, check out clonezilla.

share|improve this answer
Also, in addition to what the answer psny linked to, it wouldn't hurt to create a back up of the whole /etc/ directory which stores system wide settings. If you've made some changes there, it would be helpful to have an archive to get those changes from. – Marcin Kaminski Dec 1 '12 at 15:12
If you have any crontabs setup, then backup /var/spool/cron too. – Ian Dunn Apr 29 '15 at 7:08

If I reinstall my desktop system, I backup

  • /etc
  • /var, I'm too lazy to exclude some sub-folders
  • /opt

/home is on a separate partition and has a backup made every day.

After the reinstall, I restore the parts from my backup, which I really need.

With this strategy, all my configurations, local mails and crontab configurations are safe and I have to reinstall my needed applications only.

My personal scripts are saved in my home folder (daily backup, remember?), therefore I don't use /usr/local.

share|improve this answer
Will it work if I backup root, that is everything?: ./ – Suspended Feb 25 at 13:25
That would be like a clone of what I'm using now. – Suspended Feb 25 at 13:26

Use Deja Dup backup. It is provided by default. Go to settings and keep only root folder (/) as "folders to include" and add media folder (/media) in "folders to ignore".

Because of this, all your programs will be backed up in case of system damage (rare) except your other drives which normally remain unaffected.

share|improve this answer

Just a reminder if you're using DejaDup (or anything else really), also exclude any cloud storage folders (likely in your home), such as Dropbox. If you're paying for s3 storage this could be a bad mistake.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.