I'm using a Ubuntu 14.04.4 LTS on my server. Is there a way to zip everything on the server in a single archive, preferably with a single command?
I've tried using
zip -r backup.zip
Run Code Online (Sandbox Code Playgroud)
but that doesn't work, since I'm not providing it with what I would like to zip. I have also tried using
zip -r backup.zip *.*
Run Code Online (Sandbox Code Playgroud)
but that only zips the files, and not the directories.
I am aware that I could go with
zip -r var.zip var
zip -r root.zip root
zip -r media.zip media
etc
Run Code Online (Sandbox Code Playgroud)
Since that would be time consuming, I'm looking for an easier solution, if it exists.
EDIT Use of 3rd party software, like Clonezilla, is not allowed. I have to find a command line solution.
小智 6
You'd be better off creating a compressed tarball archive.
A typical command for doing this for an entire system is...
tar -cvpzf /backup.tar.gz --exclude=/backup.tar.gz --one-file-system /
Run Code Online (Sandbox Code Playgroud)
See https://help.ubuntu.com/community/BackupYourSystem/TAR