Sponsored Content
Full Discussion: Backup files per Date String
Top Forums Shell Programming and Scripting Backup files per Date String Post 302188255 by drewrockshard on Wednesday 23rd of April 2008 03:56:16 AM
Old 04-23-2008
Error Backup files per Date String

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
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Backup Date & Time

:confused: I'm not really sure about the default backup date & time in our Unix system and I would like to change it to a convienient time...how do I do that? Please help? (1 Reply)
Discussion started by: EbeyeJJ
1 Replies

2. Shell Programming and Scripting

backup of files for a specific date

I want to write script for backing up archive logs files for specific date. please give me idea for that. (2 Replies)
Discussion started by: akm9999
2 Replies

3. Filesystems, Disks and Memory

backup of files for a specific date

In Linux Advance server I want to write one script for backing up files for a specific date like 24/07/2008. (3 Replies)
Discussion started by: akm9999
3 Replies

4. Homework & Coursework Questions

Date comparison with 'string date having slashes and time zone' in Bash only

1. The problem statement, all variables and given/known data: I have standard web server log file. It contains different columns (like IP address, request result code, request type etc) including a date column with the format . I have developed a log analysis command line utility that displays... (1 Reply)
Discussion started by: TariqYousaf
1 Replies

5. Shell Programming and Scripting

How to backup latest date files?

Hi, I have below two situations to handle, 1. I have list of files with file names having date&time. I have to backup to old date files. say I have below files in a directory, 1. XX123_20101004010101.dat 2. XX124_20101004010201.dat 3. XX121_20101003010101.dat 4.... (6 Replies)
Discussion started by: smr_rashmy
6 Replies

6. Shell Programming and Scripting

mv files add date string

I have a requirement where I need to move files that are being written too. I am unable to use sed since I believe this will stop the files from getting written. There is a directory containing about 50 unique files, the date is the same on all of them. I need to change the date string on each... (1 Reply)
Discussion started by: jaysunn
1 Replies

7. Shell Programming and Scripting

Faster Line by Line String/Date Comparison of 2 Files

Hello, I was wondering if anyone knows a faster way to search and compare strings and dates from 2 files? I'm currently using "for loop" but seems sluggish as i have to cycle through 10 directories with 10 files each containing thousands of lines. Given: -10 directories -10 files... (4 Replies)
Discussion started by: agentgrecko
4 Replies

8. Shell Programming and Scripting

Find and copy files based on todays date and search for a particular string

Hi All, I am new to shell srcipting. Problem : I need to write a script which copy the log files from /prod/logs directory based on todays date like (Jul 17) and place it to /home/hzjnr0 directory and then search the copied logfiles for the string "@ending successfully on Thu Jul 17". If... (2 Replies)
Discussion started by: mail.chiranjit
2 Replies

9. Shell Programming and Scripting

How to list files that are not first two files date & last file date for every month-year?

Hi All, I need to find all files other than first two files dates & last file date for month and month/year wise list. lets say there are following files in directory Mar 19 2012 c.txt Mar 19 2012 cc.txt Mar 21 2012 d.txt Mar 22 2012 f.txt Mar 24 2012 h.txt Mar 25 2012 w.txt Feb 12... (2 Replies)
Discussion started by: Makarand Dodmis
2 Replies

10. Shell Programming and Scripting

Extract count of string in all files and display on date wise

Hi All, hope you all are doing well! I kindly ask you for shell scripting help, here is the description: I have huge number of files shown below on date wise, which contains different strings(numbers you can say) including 505001 and 602001. ... (14 Replies)
Discussion started by: VasuKukkapalli
14 Replies
BDB.DB0(5)							AFS File Reference							BDB.DB0(5)

NAME
bdb.DB0, bdb.DBSYS1 - Contain the Backup Database and associated log DESCRIPTION
The bdb.DB0 file contains the Backup Database, which records configuration information used by the AFS Backup System along with cross- indexed records of the tapes created and volumes dumped using the Backup System commands. The bdb.DBSYS1 file is a log file in which the Backup Server (buserver process) logs each database operation before performing it. When an operation is interrupted, the Backup Server replays the log to complete the operation. Both files are in binary format and reside in the /var/lib/openafs/db directory on each database server machine that runs the Backup Server. When the Backup Server starts or restarts on a given machine, it establishes a connection with its peers and verifies that its copy of the bdb.DB0 file matches the copy on the other database server machines. If not, the Backup Servers use AFS's distributed database technology, Ubik, to distribute to all of the machines the copy of the database with the highest version number. Use the commands in the backup suite to administer the Backup Database. It is advisable to create a backup copy of the bdb.DB0 file on tape on a regular basis, using the UNIX tar command or another local disk backup utility. SEE ALSO
backup(8), backup_savedb(8), buserver(8) COPYRIGHT
IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved. This documentation is covered by the IBM Public License Version 1.0. It was converted from HTML to POD by software written by Chas Williams and Russ Allbery, based on work by Alf Wachsmann and Elizabeth Cassell. OpenAFS 2012-03-26 BDB.DB0(5)
All times are GMT -4. The time now is 06:11 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy