backup shell script, need some tips.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting backup shell script, need some tips.
# 1  
Old 03-28-2008
backup shell script, need some tips.

Hello everyone:

I am in the process of developing a shell script that will help me do the following:

1. I will backup to a mounted drive creating a folder for each day
2. After 45 days the first backup needs to be deleted, now, this has to happen everyday after I hit 45 days for the first time because after I hit 45 days for the first time the script will need to delete the oldest backup.
3. The script will execute using cronjob every night at 10 PM from Monday through Friday.

This is what I have so far:

date >> start
DT=`date "+%y%m%d"`
mkdir /nethdd/$DT
find /usr -print | cpio -pdmuv /nethdd/$DT
find /usr3 -print | cpio -pdmuv /nethdd/$DT
date >> end

As you can see I do not know how to start deleting the oldest every day after I hit 45 days for the first time.
# 2  
Old 03-28-2008
Google is your friend. Try "shell delete older".
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Help with Backup Shell Script

hello guys i am new and i am using Solaris 8 as operating system. i have some CD and i want to install the data from it. Package and patches. Which command shall i use? thanks (3 Replies)
Discussion started by: moh_abaloo
3 Replies

2. Shell Programming and Scripting

Help with Backup Shell Script

Dear friends, I need your help. I need to create a bash script which can loop through $source_dir once a month, and find the backup of the last day of a given month for each of the 2 file types, as can be seen below. Assume that source_dir="/backup/daily" Assume that... (1 Reply)
Discussion started by: joemb
1 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

Hello guys. I am a Brazilian, I use a linux machine, to access it using the program Putty. I own a GTA Multiplayer, I have a folder on my server named accounts, there is the account of all players. Each player has their own file, the files are saved as follows: PlayerName.ini I would... (4 Replies)
Discussion started by: JimCarrey
4 Replies

5. 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

6. Shell Programming and Scripting

shell script to backup

Q: script to daily backup all databases in the server, retain only last 4 backps please anyone give me a reply (3 Replies)
Discussion started by: pssooraj72
3 Replies

7. Homework & Coursework Questions

Help with Backup Shell Script

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Create a script that will backup all important system files every Friday night and send an email to the... (6 Replies)
Discussion started by: kjmpa26
6 Replies

8. Shell Programming and Scripting

Help with backup script in C-shell

Hi I am trying to back up files with cshell script .And I have to pass the size of the files,the backup directory and the file Could you help me with advises ,and am I useing find right thanks #!/bin/csh if( $2 =="") then echo "Please provide correct parameters" echo "corect call is: ... (7 Replies)
Discussion started by: lio123
7 Replies

9. Shell Programming and Scripting

Need help with a backup shell script

am writing my very first shell script and need some assistance. What I need help on is three things in particular. 1) Do I need to use the sleep function after the tar command or does the script know to wait until tar finishes to move on to the next line? 2) Did I populate the variable DATE... (4 Replies)
Discussion started by: rhm54
4 Replies

10. UNIX for Dummies Questions & Answers

Learning Tips - UNIX Shell Script

Can any one please provide a fast learning tips to learn UNIX shell scripting? Thanks, Gov (3 Replies)
Discussion started by: Govindh.v
3 Replies
Login or Register to Ask a Question