Skip to content

Instantly share code, notes, and snippets.

@DevertNet
Last active February 25, 2021 13:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DevertNet/9c2b452775351a71d05a to your computer and use it in GitHub Desktop.
Save DevertNet/9c2b452775351a71d05a to your computer and use it in GitHub Desktop.
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"
# RYSNC
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 bauchemie24@bauchemie24.web.mageprofis.de:/home/bauchemie24/htdocs/ /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 https://myrepo.com/git.git 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
# ROOT MySQL
mysql --defaults-file=/etc/mysql/debian.cnf
# SQL Export Scripts
https://gist.github.com/mklooss/962543d362a605b12c78ebeb71669188
# PHP SSH "Hacks"
.bash_profile:
export PATH="/kunden/442232_84307/bin/:$PATH"
/kunden/442232_84307/bin/php:
ln -s /pfad/zu/php/7.2/php php
oder
/kunden/442232_84307/bin/php:
#!/bin/bash
/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