Register
It is currently Sun Sep 21, 2014 12:04 am

backup script (not broken and interactive)


All times are UTC - 6 hours


Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 PostPosted: Tue May 31, 2005 8:52 pm   
Site Admin

Joined: Tue May 17, 2005 7:31 pm
Posts: 251
Location: Georgia
5-31-05

Code:
#!/bin/bash

BACKUP_DIRS="/etc/
/root/
/home/
/var/log/"

EXCLUDE_BACKUP_EXT="iso
ogg
img
tgz
pdf
rar
tar
zip
exe
mpg
mpeg
avi
mov
gz"

BACKUP_FILENAME=`date '+%Y-%m-%d'`
BACKUP_DEST_DIR="/home/jbsnake/backups/"

cur_dir=`pwd`
echo "$EXCLUDE_BACKUP_EXT" > "${cur_dir}/excludelist.dat"
echo "$BACKUP_DIRS" > "${cur_dir}/dirs2backup.dat"


function create_exclude_list
{
   until ! read dir
   do
      until ! read extension
      do
         find "${dir}" -name "*.${extension}" 2> /dev/null >> "${cur_dir}/excludedfiles.dat"
      done < "${cur_dir}/excludelist.dat"
   done < "${cur_dir}/dirs2backup.dat"
}

create_exclude_list

tar --exclude-from "${cur_dir}/excludedfiles.dat" -czvf "${BACKUP_DEST_DIR}${HOSTNAME}--${BACKUP_FILENAME}.tgz" ${BACKUP_DIRS}


Top
 Profile  
 PostPosted: Thu Jun 02, 2005 10:15 pm   
Site Admin

Joined: Tue May 17, 2005 7:31 pm
Posts: 251
Location: Georgia
6-02-05

:: creating a function that will take user input to build a list of directories to backup

:: creating a function that will take user input to build a list of extensions to ignore during backup

:: creating a function that will take user input to build a configuration file to read from so that the script may be used automatically and no user intervention will be necessary.

so far that's all the ideas i have and are working on :) :)


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP