1.2
[olivier.git] / dotfiles / mail_db_tables.sh
1 # DB new-dev.auf
2 USERNAME=""
3 PASSWORD=""
4
5 # nom des tables avec un espace entre
6 DATABASES=""
7
8 ARCHIVE="dumps.tar.gz"
9 MESSAGE="msg"
10 DEST="olivier.larcheveque@auf.org"
11
12 cd /tmp
13
14 for db in $DATABASES
15 do
16 echo $db >> $MESSAGE
17 done
18
19 for db in $DATABASES
20 do
21 echo $db
22 mysqldump --user=$USERNAME --password=$PASSWORD --host=new-dev.auf $db > $db
23 done
24
25 tar -czf $ARCHIVE $DATABASES
26
27 mutt -s 'dumps' -a $ARCHIVE -c $DEST < $MESSAGE
28
29
30 for db in $DATABASES
31 do
32 rm $db
33 done
34 rm $ARCHIVE $MESSAGE