grep "sshd.*Accepted" /var/log/auth.log | awk '{print $11}' | sort | uniq
grep "sshd.*Accepted" /var/log/secure | awk '{print $11}' | sort | uniq
grep "sshd.*Accepted" /var/log/auth.log | awk '{print $11}' | sort | uniq
grep "sshd.*Accepted" /var/log/secure | awk '{print $11}' | sort | uniq
greitas top direktoriju radikjlis, randantis net giliai esancias direkmtorijas
{ find / -xdev -printf '%h\n' | sort | uniq -c | sort -k 1 -n; } 2>/dev/null
vienos direktorijos inode counteris:
find . -printf "%h\n" | cut -d/ -f-2 | sort | uniq -c | sort -rn
greitas trynimas senesniu nei 20d failu
find /opt/remi/php54/root/var/lib/php/session/ -atime +20 | xargs -r rm
#!/bin/bash
USER="dfdsf"
PASSWORD="sdfdsf"
OUTPUT="/path/to/dir/"
databases=`mysql -u $USER -p$PASSWORD -e "SHOW DATABASES;" | tr -d "| " | grep -v Database`
for db in $databases; do
if [[ "$db" != "information_schema" ]] && [[ "$db" != "performance_schema" ]] && [[ "$db" != "mysql" ]] && [[ "$db" != _* ]] ; then
echo "Dumping database: $db"
mysqldump -u $USER -p$PASSWORD --databases $db | gzip > $OUTPUT/$db._`date '+%Y-%m-%d_%T'`.sql.gz
fi
done
you save the code in file backup.sh $ chmod +x