Wuu Posted March 14, 2016 Report Share Posted March 14, 2016 #!/bin/bash NOW=$(date +"%m-%d-%Y") echo $NOW #creat db backup mongodump -u ****** -p ****** -o /home/mongod/mongobackup/mongodBackup-$NOW --gzip tar -cvzf mongodBackup-$NOW.tar.gz /home/mongod/mongobackup/mongodBackup-$NOW HOST='******' USER='******' PASSWD='******' FILE='mongodBackup-'$NOW'.tar.gz' ftp -n $HOST <<END_SCRIPT quote USER $USER quote PASS $PASSWD cd /mongodbbackup put $FILE quit END_SCRIPT exit 0 Mēģinu saspiest mongodumpu un ielādēt uz serveri, bet atverot rāda ka arhīvs ir saplēsts. Kas varētu būt pa vainu? Ubuntu Quote Link to comment Share on other sites More sharing options...
ieleja Posted March 14, 2016 Report Share Posted March 14, 2016 nav divreiz saarhivēta? Quote Link to comment Share on other sites More sharing options...
jurchiks Posted March 14, 2016 Report Share Posted March 14, 2016 ISO 8601 pls. Quote Link to comment Share on other sites More sharing options...
Wuu Posted March 15, 2016 Author Report Share Posted March 15, 2016 ftp pie vainas, ftp -n $HOST <<END_SCRIPT quote USER $USER quote PASS $PASSWD binary cd /mongodbbackup put $FILE quit END_SCRIPT exit 0 Pieliku binary, un viss aizgāja. Paldies :) Quote Link to comment Share on other sites More sharing options...
Mr.Key Posted March 15, 2016 Report Share Posted March 15, 2016 (edited) Es pareizi saprotu, ka tu vispirms viņu ar mongo dump tūli saspied ar parametru --gzip, un pēc tam tar tūlim pieliec -z parametru otreizējai zipošanai? Edited March 15, 2016 by Mr.Key Quote Link to comment Share on other sites More sharing options...
Wuu Posted March 15, 2016 Author Report Share Posted March 15, 2016 Jā, ideja tāda bija, jo mongodump uztaisi kaudzi ar failiem un mapītēm, gribās vienu. Beigu variantā noņemu --gzip, jo saspiežu pa taisno mapītes un failus. Nav jēga divreiz saspiest. Quote Link to comment Share on other sites More sharing options...
daGrevis Posted March 15, 2016 Report Share Posted March 15, 2016 Ja gribi dabūt vienu lielu failu, izmanto tar (bez gz). Quote Link to comment Share on other sites More sharing options...
Kasspars Posted March 15, 2016 Report Share Posted March 15, 2016 kopē ar scp uz otra servera uzliec ssh atslēgu un nevajadzēs skriptā rakstīt paroles Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.