linux - split scp of backup files to different smb shares based on date -
i backup files tar files once day , grab our ubuntu servers using backup shell script , put them in share. have 5tb shares can have several.
at moment need more backup 30 days worth of tar files.
i need method first 10 days go share one, next ten share tow, next 11 share three
currently each server vm runs following script backup , tar folders , place in folder ready grabbed backup server
!/bin/bash appname=myapp.com dbname=mydb dbuser=mydbuser dbpass=mydbpass datestamp=`date +%d%m%y` rm -f /var/mybackuptars/* > /dev/null 2>&1 mysqldump -u$dbuser -p$dbpass $dbname > /var/mybackups/$dbname-$datestamp.sql && gzip /var/mybackupss/$dbname-$datestamp.sql tar -zcf /var/mybackups/myapp-$datestamp.tar.gz /var/www/myapp > /dev/null 2>&1 tar -zcf /var/mydirectory/myapp-$datestamp.tar.gz /var/www/html/myapp > /dev/null 2>&1
i grab backups using script on backup server , put them in share
#!/bin/bash # # generate list of myapps grab df|grep myappbackups|awk -f/ '{ print $nf }'>/tmp/myapplistlistsmb # each app in turn appname in `cat /tmp/applistsmb` cd /srv/myappbackups/$appname scp $appname:* . done
i know tough 1 need 3 shares ten days worth in each share
i not anticipate backup script changing on each server vm backs itself
only maybe grabber script puts dated backups in share on backup server
or wrong??
any great
Comments
Post a Comment