cli

warning: Creating default object from empty value in /data/web/1/000/027/003/273448/htdocs/panticz.de/modules/taxonomy/taxonomy.pages.inc on line 33.

rsync

# on-the-fly backup (backup whole running system)
rsync -av --delete --numeric-ids --exclude=dev/* --exclude=proc/* --exclude=sys/* --exclude=tmp/* --exclude=media/* root@example.com:/ .

# limit bandwith to 2 mbit/s
rsync --bwlimit=2000 --delete -avz root@www.example.com:/ /media/backup/www.example.com/$(date -I)/

# specify SSH key and configuration
sudo rsync -av \
-e "ssh -i /home/foo/.ssh/id_rsa -F /home/foo/.ssh/config" \
--delete \
--numeric-ids \
-av \
/from/dir/ root@192.168.0.1:/to/dir

find

# find files without read / write permissions for other
find /media/foo /media/bar ! -perm -o+rw -exec ls -l {} \;
find /media/foo /media/bar -ctime -1 -type f ! -perm -go+rw -exec chmod a+rw {} \;
find /media/foo /media/bar -1 -type d ! -perm -go+rwx -exec chmod 777 {} \;

# find all empty files
find /tmp -type f -empty

# find empty directories
find . -type d -empty

# print file content
find ./ -type f | while read f; do printf "\n# file %s\n" "$f"; cat "$f"; done

# find files by date
find /path/to/dir -newermt "yyyy-mm-dd"

# list all files modified on given date

Syndicate content