Skip to content

Instantly share code, notes, and snippets.

@AlexKratky
Created February 7, 2021 11:56
Show Gist options
  • Save AlexKratky/b6547f6df4ac517b06893e9ef0138f53 to your computer and use it in GitHub Desktop.
Save AlexKratky/b6547f6df4ac517b06893e9ef0138f53 to your computer and use it in GitHub Desktop.
backup whole server to .tar.gz file without .node_modules/ and vendor/ directory
cd /
# backup.tar.gz is the file name and we exclude that file from backuping (recursion)
# the ending slash is the directory you going to backup ( '/' is whole filesystem)
tar -cvpzf backup.tar.gz --exclude=/backup.tar.gz --exclude="node_modules" --exclude="vendor" --exclude=/swapfile --one-file-system /
# more info at https://help.ubuntu.com/community/BackupYourSystem/TAR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment