Skip to content

Instantly share code, notes, and snippets.

Last active Feb 25, 2021
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
# Show Size of untracked files
git status --porcelain | awk '{print $2}' | xargs ls -hs | sort -h
mysql --defaults-file=/etc/mysql/debian.cnf
# SQL Export Scripts
# PHP SSH "Hacks"
export PATH="/kunden/442232_84307/bin/:$PATH"
ln -s /pfad/zu/php/7.2/php php
/usr/local/bin/php7-72LATEST-CLI -d memory_limit=1024M "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment