The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Script to archive file indira UNIX for Dummies Questions & Answers 0 05-22-2007 10:15 AM
Archive Script-Urgent indira HP-UX 1 05-16-2007 01:31 PM
Archive Script-Urgent indira Shell Programming and Scripting 0 05-16-2007 11:45 AM
Archive script old files kayarsenal Shell Programming and Scripting 1 08-25-2006 01:46 AM
script to archive all the log files tintedwindow Shell Programming and Scripting 0 06-13-2006 10:51 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-14-2007
jimmyc jimmyc is offline
Registered User
  
 

Join Date: Dec 2006
Location: dallas tx
Posts: 43
making a archive script

Hi All: I’m not much of a script writer so I could use your input. Here’s the objective…
Need a script that will archive (tar) files based on date and then move them into an archive directory. The file names are as follows…
S20070101.001 Year month day
S20070102.001
As you can see this may not be too difficult since you are not having to hunt for the actual date created… I would like to be able to keep 2 weeks as flat txt file and then tar up the rest in either a weekly or bi-monthly tar file… This will be on a Solaris 8/10 boxs running k shell.

Thanks all for your input…!!
  #2 (permalink)  
Old 09-15-2007
cfajohnson's Avatar
cfajohnson cfajohnson is offline Forum Advisor  
Shell programmer, author
  
 

Join Date: Mar 2007
Location: Toronto, Canada
Posts: 2,361
Quote:
Originally Posted by jimmyc View Post
Hi All: I’m not much of a script writer so I could use your input. Here’s the objective…
Need a script that will archive (tar) files based on date and then move them into an archive directory. The file names are as follows…
S20070101.001 Year month day
S20070102.001
As you can see this may not be too difficult since you are not having to hunt for the actual date created… I would like to be able to keep 2 weeks as flat txt file and then tar up the rest in either a weekly or bi-monthly tar file… This will be on a Solaris 8/10 boxs running k shell.

Code:
date=20070102
archivedir=/path/to/wherever/
tar cf "$date.tar" *"$date"*
mv *"$date"* "$archivedir"
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:18 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0