Zálohování MySQL
Z Wiki UnArt Slavičín
#!/bin/bash USER="root" PASS="supertajneheslo:-)" DIR="/cesta/kam/zalohovat/" mysql -N -u "$USER" --password="$PASS" -e "SHOW DATABASES" | tail -n+1 | while read DB; do mkdir -p $DIR$DB"/"`date +"%Y/%m/"` FILE=$DIR$DB"/"`date +"%Y/%m/%d"`".sql" echo "Ukladam zalohu databaze $DB do souboru $FILE..." mysqldump -u "$USER" --password="$PASS" --routines "$DB" > "$FILE" done