SHARE
TWEET

Untitled

a guest May 31st, 2017 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. STAMP=`date '+%Y_%m_%d'`
  4. DBUSER=root
  5. DBPASS=
  6. for i in `ls /home/`; do
  7.   export LUSER=$i
  8.   for x in `mysql -u$DBUSER -p$DBPASS -e 'show databases'|grep ^"$LUSER"_`; do
  9.   # x je database name u ovom slucaju, dodaj/oduzmi stamp gdje ti pashe u nazivu
  10.   mysqldump -u$DBUSER -p$DBPASS $x|gzip  > /home/$LUSER/backup/$STAMP-$x.sql.gz
  11.   done
  12. done
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top