- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- appending tar backup.
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2006 10:00 PM
03-03-2006 10:00 PM
I need to take the backup of my rmon log files once in a month. I prefer to append the used tape every month. the directory structure i use to backup is as follows.
drwxrwxrwx 2 sysdba dba 1024 Dec 6 03:24 2005-07-20
drwxrwxrwx 2 oracle dba 1024 Jan 1 22:09 2006-01-01
drwxrwxrwx 2 oracle dba 1024 Jan 2 22:09 2006-01-02
drwxrwxrwx 2 oracle dba 1024 Jan 3 22:09 2006-01-03
drwxrwxrwx 2 oracle dba 1024 Jan 4 22:18 2006-01-04
drwxrwxrwx 2 oracle dba 1024 Jan 5 22:10 2006-01-05
drwxrwxrwx 2 oracle dba 1024 Jan 6 22:10 2006-01-06
So my plan is to take the backup the log directories of dec and delete those from system.So only jan and Feb will be available on system.So i would like to schedule this every month.
Can anyone suggest a script using tar to schedule a cron for this.
Thanks in advance.
Manoj
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2006 01:19 AM
03-04-2006 01:19 AM
Re: appending tar backup.
If I understood ypur needs correctly, you have to do the following each first day of a month:
BACKDIR=/rmonback
TAPENAME=/dev/rmt/0m
find $BACKDIR -type d -mtime +60 -exec rm -r {} \;
tar cf $TAPENAME $BACKDIR
HTH
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2006 06:08 AM
03-04-2006 06:08 AM
SolutionAs per my interpretation, following is the script....
--------------------------------------------
#!/usr/bin/sh
BCK_PARENT_DIR=/oracle/rmonback
TAPEDRIVE=/dev/rmt/0m
cd $BCK_PARENT_DIR
# Backup using append mode,the 2 month prior Dir's with relative path mode(helpful while restoring).
find ./* -type d -prune -mtime +60 | xargs tar rvf $TAPEDRIVE 1> /tmp/`date +%b`_rmonbck.log 2>&1
# Remove the 2 month prior Dir's for clean up, leaving the log files of last 2 months.
find ./* -type d -prune -mtime +60 | xargs rm -rf
--------------------------------------------
You can schedule the script to run once every month say by 1s't day of the month. Ofcourse you can check the log file by name "/tmp/Jan.log" to see the backup activity performed for that month.
Regards,
Senthil Kumar .A
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2006 06:18 AM
03-04-2006 06:18 AM
Re: appending tar backup.
Please check the attached script. The lines are split into 2 ,though it is single line in the display of my previous post.
ftp the script to the unix box and test first. Remove the second "find" command line while testing. Once satisfied, u can use the second "find"command aswell.
Regards,
Senthil Kumar .A
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2006 08:50 PM
03-19-2006 08:50 PM
Re: appending tar backup.
Thanks a lot for the help.
Regards
Manoj