Quote:
Originally posted by dieharrd
I was wonder if anyone out there had any information about this.
I have both linux and windows2000 servers running. I was wondering if there is a way you can backup files/db/etc of a linux machine from a windows 2000 server machine? I want to have it scheduled to do this automatically daily.
If you have any ideas, or know where i can look. Much appreciated.
|
First, get the 'curl' utility, and Read The Fine Manual. Second, check man mkfifo if you don't know what mkfifo does. Third, make sure you've got IIS running on your Windows box.
Code:
mkfifo somefifo.tgz
tar -czf somefifo.tgz /some/directory/* &
curl --upload-file somefifo.tgz --user username:password --url ftp://ftp.host.net/ &
The second and third commands should either be run in background or in separate terminals. If tar needs to run as root, sudo -b will do the trick.
You can put these in your crontab to have the Linux box automatically perform this backup. Check man crontab, man cron. Also poke around for a utility called "anacron" which will handle missed jobs.
The basic idea is that as tar is writing to the fifo (pipe), curl is reading from it and uploading. Curl is the only utility I've found that can upload, via FTP, from a pipe.
Another useful utility is 'wget' because it can mirror directories via FTP. If you're not worried about preserving symbolic links and timestamps, that might be the way to go.
A simple method would be to have a script that asks your DBMS to dump a copy of its data to a directory and then have wget mirror those data files, or you could stop the DBMS, mirror it, and then restart it.