WebFaction
Community site: login faq

I have a backup file that is generated locally daily, is there an easy way to FTP it offsite with a cron job?

asked 22 Feb '12, 11:02

unflinching
111
accept rate: 0%

Does the file always have the same name when it's generated?

BTW, I prefer to pull backups instead of pushing them (i.e. downloading them on the offsite-location instead of uploading it to it).

(22 Feb '12, 13:41) slashfoo

The usual method of doing this is using rsync. Type man rsync to find out how to use it and its options.

permanent link

answered 23 Feb '12, 02:09

todork
1.2k4
accept rate: 34%

I made a simple python script that:

  1. Creates a dump of all MySQL databases
  2. Creates an "svnadmin dump" of all svn repositories (folders under ~/webapps with "svn" in the name)
  3. Pushes all of this, including my bin and webapps directories, to bitbucket via git

This is then run daily through cron.

I've posted the code here: http://community.webfaction.com/questions/4481/easy-way-to-backup-all-webapps-and-databases?page=1#12292

permanent link

answered 01 Feb '13, 11:30

Madsn
4314
accept rate: 0%

edited 01 Feb '13, 13:22

Hello,

This is an old thread, but I decided to share a simple script that does the job:

#!/bin/bash

HOST=example.com
PORT=2121
USERNAME=someuser
PASS=somepass

ftp -n -i $HOST $PORT <<-EOF
user $USERNAME $PASS
cd /backups
lcd $HOME/backups
passive
bin
mput backup1.tar.gz
mput backup2.tar.gz
bye
EOF

echo "Done!"

Of course, change the variables at the start of the script to your values.

Sincerely,

Valentin I.
WebFaction Support
--
WebFaction - Smarter web hosting
http://webfaction.com
http://twitter.com/webfaction - http://facebook.com/webfaction

permanent link

answered 03 Feb '13, 08:46

valentini
2614
accept rate: 28%

I am running a backup scrip that has the password in it as in the example cited here.

I have (in part):

MyUSER="bici" # USERNAME MyPASS="somerandomstring" # PASSWORD MyHOST="localhost" # Hostname

    $MYSQLDUMP -u $MyUSER -h $MyHOST -p$MyPASS $db | $GZIP -9 > $FILE

But ever since moving to a new server i get an error message:

"Warning: Using a password on the command line interface can be insecure."

why would i get this error message after having moved from Web368(?) to web515

(05 Jun '17, 00:23) baba

why would i get this error message after having moved from Web368(?) to web515

Your new server runs a newer version of MySQL. The error message doesn't exist in the folder version.

(05 Jun '17, 20:31) seanf
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×62
×36

question asked: 22 Feb '12, 11:02

question was seen: 4,087 times

last updated: 05 Jun '17, 20:31

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM