Working with backup files on a debian linux server

The very basic "zip and unzip" process that is useful to get a copy of a production system for development or as a backup.

19.01.2019 - Manuel Wohlers

Compressing and packaging

## first check if there is anough space left at the target volume using "df" and "du"! df -h
du -sh files
tar --exclude='./myfolder' --exclude='*.tmp' -zcvf archive.tgz files

Multiple files and directories may follow to put them together in one single archive.

you can use wildcard to exclude multiple files at once: 

--exclude='./logs/log-2012-*'

you can prefix with './' to exclude only files on root/current working dir:

--exclude='./my-file'

In a TYPO3 context you may want to archive only files without processed folders:

tar --exclude='_processed_' --exclude='_temp_' -zcvf files.tgz fileadmin

Copy the created files to your local machine with e.g.

scp remoteuser@remoteserver:/remote/folder /my/local/directory/