Changeset 1011 for cpc/trunk/project/bin


Ignore:
Timestamp:
Jan 5, 2010, 11:13:29 PM (11 years ago)
Author:
teymour
Message:

Plus générique (donc utilisable pour RegardsCitoyens?.org par exemple)

Location:
cpc/trunk/project/bin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpc/trunk/project/bin/autodump

    r1000 r1011  
    22source bin/db.inc
    33
    4 mysqldump $MYSQLID $DBNAME -q --single-transaction --add-drop-table -R -t --disable-keys --complete-insert | gzip > data/sql/dumps/nosdeputes.$(date +%y%m%d).sql.gz
     4mysqldump $MYSQLID $DBNAME -q --single-transaction --add-drop-table -R -t --disable-keys --complete-insert | gzip > $DUMPDIR/$DBNAME.$(date +%y%m%d).sql.gz
    55
    66# On archive tous les 1er du mois et tous les dimanches
    77if [[ $(date +%-w) -eq 0 || $(date +%-d) -eq 1 ]]; then
    8   cp data/sql/dumps/nosdeputes.$(date +%y%m%d).sql.gz data/sql/dumps/archives/
     8  cp $DUMPDIR/$DBNAME.$(date +%y%m%d).sql.gz $DUMPDIR/archives/
    99fi
    1010
     
    1919  fi
    2020  ym=`printf "%02d%02d" $year0 $month0`
    21   rm -f `ls data/sql/dumps/archives/nosdeputes.${ym}*.sql.gz | grep -v nosdeputes.${ym}01.sql.gz`
     21  rm -f `ls $DUMPDIR/archives/$DBNAME.${ym}*.sql.gz | grep -v $DBNAME.${ym}01.sql.gz`
    2222fi
    2323
     
    2828  day0=`expr $(date +%d) - 7`
    2929fi
    30 rm -f data/sql/dumps/nosdeputes.*`printf "%02d" $day0`.sql.gz
     30rm -f $DUMPDIR/$DBNAME.*`printf "%02d" $day0`.sql.gz
    3131if [[ $(date +%-d) -eq 8 ]]; then
    32   rm -f data/sql/dumps/nosdeputes.*29.sql.gz
    33   rm -f data/sql/dumps/nosdeputes.*30.sql.gz
    34   rm -f data/sql/dumps/nosdeputes.*31.sql.gz
     32  rm -f $DUMPDIR/$DBNAME.*29.sql.gz
     33  rm -f $DUMPDIR/$DBNAME.*30.sql.gz
     34  rm -f $DUMPDIR/$DBNAME.*31.sql.gz
    3535fi
    3636
  • cpc/trunk/project/bin/db.inc

    r873 r1011  
    11MYSQLID="-u cpc -pM_O_T__D_E__P_A_S_S_E"
    22DBNAME="cpc"
     3DUMPDIR="data/sql/dumps"
Note: See TracChangeset for help on using the changeset viewer.