Saturday, August 4, 2007

FreeBSD tar ftp script

Simple script I used to backup files on a FreeBSD server to an ftp site.


#!/usr/local/bin/bash

rm -r /usr/backup/*

tar zcvf /usr/backup/apache_conf.tar.gz /usr/local/apache2/conf/*
tar zcvf /usr/backup/apache_logs.tar.gz /usr/local/apache2/logs/*
tar zcvf /usr/backup/www.tar.gz /usr/local/www/*

ftp -n -v 1.2.3.4 << EoF
user username password
lcd /usr/backup
bin
prompt
mput *



---------------------------------
www.wildmpg.com

No comments: