Backups with tar…

#!/bin/sh

## GertMul

## Setup variables
file=`date +”%Y%m%d_%H%M%S”`
extension=_inc_data.tar.gz
store_folder=/mnt/backup_store_remote
store_remote=//10.0.0.1/backups
temp_folder=/mnt/backups

## Mark the start
echo -e “$file$extension \n” > $temp_folder/$file$extension.err

## Cleanup
find /mnt/data -type d | /var/srpl.pl
find /mnt/data -type d | /var/srpl.pl
## End Cleanup

## Mount
smbumount $store_folder
smbmount $store_remote $store_folder -o username=”backupusername%backuppassword” 2>>$temp_folder/$file$extension.err

## List
find /mnt/bioscaledata -type f -daystart -mtime -2 > $temp_folder/$file$extension.list

## Tar and Zip
tar -zcvf $temp_folder/$file$extension –files-from $temp_folder/$file$extension.list 2>$temp_folder/$file$extension.errtar 1>$temp_folder/$file$extension.log

## Mark the End
endtime=`date +”%Y%m%d_%H%M%S”`
echo -e “__end at $endtime” >> $temp_folder/$file$extension.err

## Move the files over
cp $temp_folder/$file$extension.err $store_folder/.
mv $temp_folder/$file$extension.errtar $store_folder/.
mv $temp_folder/$file$extension $store_folder/.
cp $temp_folder/$file$extension.list $store_folder/.

## Mark the Very End
echo -e “__moving at $endtime” >> $temp_folder/$file$extension.log
cp $temp_folder/$file$extension.log $store_folder/.

## Unmount the remote share
smbumount $store_folder

Advertisements

~ by nambabwe on 2007/03/07.

 
%d bloggers like this: