![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
| Convert String to Date | ORatjeuh | Shell Programming and Scripting | 2 | 05-06-2008 07:49 AM |
| Sorting Files by date and moving files in date order | rebel64 | Shell Programming and Scripting | 2 | 03-11-2008 12:45 PM |
| Date parsing into string, help! | martyb555 | Shell Programming and Scripting | 5 | 02-17-2008 10:12 PM |
| Extracting a string from one file and searching the same string in other files | mohancrr | Shell Programming and Scripting | 1 | 09-19-2007 04:17 AM |
| Backup Date & Time | EbeyeJJ | UNIX for Dummies Questions & Answers | 1 | 09-06-2005 11:14 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Guys, I've got a quick logic question. I'm pretty savvy when it comes to shell scripting, however, I'm at a loss when it comes to writing a simple shell script to backup only certain files out of the month. I have a directory, for example, /data/backups/websites/domain. In each "domain" directory, there are files that are named by the date of when they were created, for example: Code:
deckerd-2008-04-11.tar.gz deckerd-2008-04-12.tar.gz deckerd-2008-04-13.tar.gz deckerd-2008-04-14.tar.gz deckerd-2008-04-15.tar.gz deckerd-2008-04-16.tar.gz deckerd-2008-04-17.tar.gz deckerd-2008-04-18.tar.gz deckerd-2008-04-19.tar.gz deckerd-2008-04-20.tar.gz The string is: domain-year-month-day.tar.gz All I'm wanting to do is backup one file per week, and create a monthly backup (about 4 backups per month). Maybe I should change the string creation to a "day" and just backup "sun" (sunday) for that current month and then backup the backups - that might work. However, I am wanting to run a backup everyday, then at the end of the month, backup the 4 (sometimes just 3) backups of that month and create a monthly backup. The reason being that if I need a daily backup during the month I have it, but after that month is over, I should (maybe) only need a weekly backup. This is how I want my system to be, and just needed some insight on how to actually get the individual (3 or 4 backups per month) to work. I already have it down how to create the backups and such, but taking what is currently being backed up (30 or 31 backups), and then at the end of the month, do the weekly backups (the part I'm wanting help with). If anyone has any code snippets or just a few lines of "this could work" or "try this", I'd be very grateful. Thanks in advanced, Drew |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|