Jump to content
php.lv forumi

Saspiest mongo datubāzes dumpu un nosūtīt uz ftp ar .sh


Wuu

Recommended Posts

#!/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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...