Backing up FreeBSD onto a Windows NT WorkstationI have a Windows NT workstation. And it contains a DAT drive. So this topic is near and dear to my heart. So thanks to Chris for writing this article.
27 November 1999 – I’ve added my backup script to the end of the article.
How to do itBacking up FreeBSD directories onto a WindowsNT Workstation – "Chris Silva" <email@example.com>
I was faced with the problem of saving all the kewl things I have done in certain directories but at the time, had only a DAT in my NTWS…
First – Lets assume you have a small network at home, like I do, and lets also assume you have added a nice FBSD firewall to keep things safe… You will need to be able to FTP into your NTWS (or Server).
So – with all that as a given, here is what I did:
I installed Peer Web Services on my NTWS, added a secure login account. Peer Web Services for NTWS is just a 10 user version of IIS – I disabled the web service, along with gopher. All I needed was the FTP abilities.
I created a script that tars certain directories on my FBSD box. I put this script in /etc/periodic/daily/ and gave it a name: in this case, 990.backup-makeworld and chmoded it with +x
After the tarring is complete, another within the same script, it logs into the NT box and "bin" and "put" the tarball there where my DAT then at 7:00 AM, calls up my ArcServe.
Notice, I add the tar routing to /etc/periodic/daily so that it run each night at 2:00 am – where the actual filename is based on the box name, and the current date, i.e.:
Which becomes: makeworld.101199.tgz
Yes – the permissions are kept, and putting it back is as easy as ftp’ing back into the FBSD box.
This works well for me even though I have since put a DAT on my BSD box.
Below is the scripting I use…
#!/bin/sh - # # $Id: ntbackup.php,v 1.24 2007/08/27 16:34:47 dan Exp $ # # To be placed as /etc/periodic/daily/990.backup-makeworld # And chmod +x echo "" echo ====== `date`: Backing up /usr/home/bitsurfer on makeworld.com cd /home/bitsurfer/backups rm *.tgz cd /usr/home tar -zcvf makeworld.`date +%m%d%y`.tgz bitsurfer/ mv *.tgz /usr/home/bitsurfer/backups echo "" echo ====== `date`: Putting tarball to NTWS cd /home/bitsurfer/backups ftp -n -v 10.3.1.10 <<EoF user (some user) (some password) bin prompt mput *.tgz
[Ed. Note: 10.3.1.10 is the IP address of Chris’ NT workstation]
Hope this helps…
Best regards, Chris
My scriptHere is the script I created to backup the important pieces of my box. I’m sure there is lots of stuff in here which could be further excluded, but I can’t be bothered trimming it down. But I’m willing to hear your comments.
WARNING: only you can decide what is important to backup on your box. This is what I decided was important to me.
[root@ducky:/usr/backups] # more backup.sh #!/bin/sh tar -zpcvf /usr/backups/archives/backup.`date +%Y.%m.%d.at.%H.%M.%S`.tgz \ -X /usr/backups/exclude.txt \ /etc \ /usr/local/ \ /usr/src/sys/i386/conf/ \ /sbin/ \ /usr/home/ \ /pub/
Don’t forget the ‘\’ at the end of each line as specified. This script creates a file with a name similar to this:
Everything in the indicated directories (/etc, /usr/local, etc) are included in the backup. With the exception of those files/directories specified in /usr/backups/exclude.txt. At present, this file contains:
This excludes any previous backups from being included within this backup. I will add to this list should discover other sub-directories which I do not wish to archive.
I have yet to set up an automated FTP of this file to another box. But that will come.