New to scripting. Help with backup script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting New to scripting. Help with backup script
# 1  
Old 07-30-2010
New to scripting. Help with backup script

Just learning how to script and am trying to create a script that will:

*change ownership to nobody
*change permissions to rw
*tar the directory
*back it up to a share
*remove backups older than 14 days

I will be doing this on a RHEL 5.3 box on my home network as practice for work that I will be doing in the fall. I do have a scripting book to also help me learn syntax and meanings of commands.

Thanks for help with any or all of the above items.
# 2  
Old 07-30-2010
Check the man for each of the following commands:
Quote:
Originally Posted by daledavis67
*change ownership to nobody
chown will surely help you. Check for -R option too
Quote:
Originally Posted by daledavis67
*change permissions to rw
chmod in that case, -R for recursivity as well.
Quote:
Originally Posted by daledavis67
*tar the directory
The command tar there. Options you might need include -z for zip, -c and -f.
Quote:
Originally Posted by daledavis67
*back it up to a share
cp (copy), mv (move) or rsync (remote copy).
Quote:
Originally Posted by daledavis67
*remove backups older than 14 days
Check for the find command, options -mtime or -ctime, alonside with rm command.
# 3  
Old 07-30-2010
Thanks so much for your time. I am sure these tips will be very helpful.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Backup Script

I have write the following script, its execution i got following error: !/bin/sh # # dy='date +%d%b%y' hn="ECTMPROD12" bk='/home/backup' sb=$bk'/'$hn # # cm_d01='tar -czf /home/backup/'$hn'_'$dy'_ofhome.tar.gz /home/oracle/ofhome' # # echo "***** start time of ECTMPROD12 backup full"... (3 Replies)
Discussion started by: rizwan.shaukat
3 Replies

2. Shell Programming and Scripting

To refire a backup job using shell scripting..........

how to write a code using shell scripting to refire a back up job if it fails with an error code of 196? (7 Replies)
Discussion started by: Pawan Ramnani
7 Replies

3. Shell Programming and Scripting

Shell script to call Oracle archive backup script when file system reaches threshold value

Hello All, I need immediate help in creating shell script to call archivebkup.ksh script when archive file system capacity reaches threshold value or 60% Need to identify the unique file system that reaches threshold value. ex: capacity ... (4 Replies)
Discussion started by: sasikanthdba
4 Replies

4. Shell Programming and Scripting

Help with Backup Shell Script for Network Device Configuration backup

HI all, im new to shell scripting. need your guidence for my script. i wrote one script and is attached here Im explaining the requirement of script. AIM: Shell script to run automatically as per scheduled and backup few network devices configurations. Script will contain a set of commands... (4 Replies)
Discussion started by: saichand1985
4 Replies

5. Shell Programming and Scripting

Backup script / Test if script is already running

Hello everyone, I have 2 questions : 1) I have a backup shell script, let's call it backup.sh, that is called every hour as a cron job. As a matter of fact a backup could last more than one hour. It mounts a NAS and then do some rsync on important directories, so really I don't want to... (2 Replies)
Discussion started by: freddie50
2 Replies

6. Shell Programming and Scripting

Need help in creating file restoration script from a backup script.

Hi all i am struggling in creating a restore of env files while doing applications clone. the first file i created for copying the important configurations file which is running perfect now for reverting the changes i mean when i am restoring these files to its original places i have to do... (7 Replies)
Discussion started by: javeedkaleem
7 Replies

7. Shell Programming and Scripting

rsync backup mode(--backup) Are there any options to remove backup folders on successful deployment?

Hi Everyone, we are running rsync with --backup mode, Are there any rsync options to remove backup folders on successful deployment? Thanks in adv. (0 Replies)
Discussion started by: MVEERA
0 Replies

8. Shell Programming and Scripting

backup Shell Scripting Need

Dear All, Am handing the 5 remote server and one backup server. all the server are the online server. so need backup files from the remote server to backup server. i need shell script with using the scp backup. Sorry for my poor english Thank you (1 Reply)
Discussion started by: vmsuresh2020
1 Replies

9. UNIX for Dummies Questions & Answers

Backup Script

Hi, My SCO Unixware 7.1.1 box is setup to run an EOD backup script, which is as follows: ---------------------------------------------------------------------- start End-of-day compress $BASE TO /home/compdir write /home/compdir to DATTAPE end ... (0 Replies)
Discussion started by: tayyabq8
0 Replies

10. Shell Programming and Scripting

A backup script

Hello I'm a new user of this forum. English is not my natural language so excuse me by advance if my sentences are not always really understandable :-p Well here is my problem. I use a panel and I need to use the backup command of this panel to backup all my customer account (created... (2 Replies)
Discussion started by: pascal
2 Replies
Login or Register to Ask a Question