Need Linux scripting help

Vicken

Senior member
Oct 10, 1999
381
0
0
Hi all, I am using ubuntu linux and I am trying to backup an ftp site with a script. I have ncftpget, but the problem is I keep getting disconnected. I also want it to tar it automatically and delete the downloaded files. I need a script that reconnects and resumes where it left off. How is this done? Also, any recommendations on backing up mysql databases automatically?
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
If you have access to cron, you can write a script that uses mysqldump to create a dump of the DB and then ftp it somewhere.
 

rmrf

Platinum Member
May 14, 2003
2,872
0
0
you could use wget to retrieve the files, I'll let someone else comment on the tar portion.

wget -cr ftp://username:_password@server.domain.com/
(minus underscore before password)

c = continue (in case connection is broken)
r = recursively. to grep through directories and grab all the files.

if you are running a machine that will have people logged in, you should look at putting your info in a file, and invoking with wget -i. this is because if anyone ran a ps on your system, the username/password would show up in the process list.

that should be enough to get you started anyway.

edit: removed from command.
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
Try looking at rsync.

It's a very advanced tool usefull for synchronizing files across insecure and slow internet links. It basicly does a 'running checksum' on files to compare any changes between them and then only transfers the changes between the machines to match the files. That way you don't waste bandwidth and it's done as quickly as possible. Works over ssh (that's configurable) and is secure, you can setup shared keys to automate it with no passwords. Much better then ssh.

You can use it to do complete backups or take snapshots. It's very scriptable and is only realy limited by your imagination.

For some examples:
http://aplawrence.com/Basics/rsync.html
http://www.mikerubel.org/computers/rsync_snapshots/

There is a interesting article about rdiff-backup, something that is designed to make backups easier but works in a similar fasion to rsync.
http://arstechnica.com/articles/columns/linux/linux-20060202.ars
On the 2nd page.
 

rmrf

Platinum Member
May 14, 2003
2,872
0
0
Originally posted by: drag
Try looking at rsync.

It's a very advanced tool usefull for synchronizing files across insecure and slow internet links. It basicly does a 'running checksum' on files to compare any changes between them and then only transfers the changes between the machines to match the files. That way you don't waste bandwidth and it's done as quickly as possible. Works over ssh (that's configurable) and is secure, you can setup shared keys to automate it with no passwords. Much better then ssh.

You can use it to do complete backups or take snapshots. It's very scriptable and is only realy limited by your imagination.

For some examples:
http://aplawrence.com/Basics/rsync.html
http://www.mikerubel.org/computers/rsync_snapshots/

There is a interesting article about rdiff-backup, something that is designed to make backups easier but works in a similar fasion to rsync.
http://arstechnica.com/articles/columns/linux/linux-20060202.ars
On the 2nd page.

at one point, I was doing a ton of debian installs, so I wanted to rsync the repository and could never get it to work. it was my first thought, but it seemed a little more difficult to set up than using wget. of course, it is way more secure, so that could have something to do with it.
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
It shouldn't be very difficult to use. It just tunnels over ssh.

As for Debian stuff... Try using apt-proxy next time. It's like a caching proxy just for Debian packages. You do one install, it downloads the packages and installs them normally. Next install you download from the local apt-proxy mirror rather then through the internet.
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |