Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Linux / Backups
# Compress and Exclude!
tar -pczf MyBackup.tar.gz /home/user/public_html/ --exclude "/home/user/public_html/tmp"
tar -pczf backup_xxx.tar.gz ./public_html --exclude "./public_html/media" --exclude "./public_html/var/cache" --exclude "./public_html/var/log"
Muss auf dem Zielsystem ausgeführt werden z.B. Lokal.
rsync --progress --exclude=var/cache --exclude=var/log --exclude=var/session --exclude=/media --exclude=/tmp -aze ssh /home/leon/htdocs/bauchemie24/
# Uncompress
tar -xzf [filename]
# Patch 7405 Fix
find -type d -exec chmod 0755 "{}" \;
find -type f -exec chmod 0644 "{}" \;
# GIT in existing Dir
git clone temp
mv temp/.git .git
mv temp/.gitignore .gitignore
mv temp/.gitattributes .gitattributes
rm -rf temp
# Remove local changes to files (not untracked files!!)
git checkout .
# Remove untracked files and dirs
git clean -fd
mysql --defaults-file=/etc/mysql/debian.cnf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.