Sponsored Content
Top Forums Shell Programming and Scripting Archiving files keeping the same structure directory Post 302844701 by csierra on Monday 19th of August 2013 10:08:31 PM
Old 08-19-2013
Oracle Archiving files keeping the same structure directory

Hello Team,

We would like to backup a lot of files inside of a structure of directories, four, five or more levels in some Ubuntu, Mac and Solaris systems.

For instance:
Code:
/home/chuck/sales/virgin/rent-quote.pdf
/home/chuck/sales/marriott/vacation-quote.pdf
/home/chuck/sales/telefonica/mobile-quote.pdf

I would like to create a shell script in order to archive the files in other filesystem with the following conditions:
1. Conserve the same original directory structure
2. Classify by year in a new directory (last date of modified)
3. Move the file to the new archive directory


output:
Code:
/backup/home/chuck/sales/2010/virgin/rent-quote.pdf
/backup/home/chuck/sales/2011/marriott/vacation-quote.pdf
/backup/home/chuck/sales/2012/telefonica/mobile-quote.pdf

In the future I would like to run this script periodically to archive files with more than 60 days old

I really appreciate it your help

Regards,

Carlos
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

disk space used for files with in a directory structure.

Hello, I am new to shell scripting and would really appreciate if someone could help me with this question. I have a directory structure as follows.. main directory is DATA under which i have different directories names fileserver01, fileserver02 ... till fileserver 15. under each... (8 Replies)
Discussion started by: kasala
8 Replies

2. UNIX for Advanced & Expert Users

MV files from one directory structure(multiple level) to other directory structure

Hi, I am trying to write a script that will move all the files from source directory structure(multiple levels might exist) to destination directory structure. If a sub folder is source doesnot exist in destination then I have to skip and goto next level. I also need to delete the files in... (4 Replies)
Discussion started by: srmadab
4 Replies

3. UNIX for Dummies Questions & Answers

copy files with directory structure

i have a text file as. /database/sp/NTR_Update_Imsi_List.sql /database/sp/NTR_Update_Imsi_Range_List.sql /database/sp/NTR_Vlr_Upload.sql /database/tables/StatsTables.sql /mib/ntr.mib /mib/ntr.v2.mib /scripts/operations/ntr/IMSITracer.ph /scripts/operations/ntr/IMSITracer.pl ... (3 Replies)
Discussion started by: adddy
3 Replies

4. SCO

Transfer files wih directory structure.

I need to transfer software off a SCO OpenServer 5.0.5 server. I can not seem to read this server's tape on my other server since the tape drive (IBM Gen 5 DAT 72GB) will continuosly "eject" this DAT 8 tape. I have been able to 'tarball' most of the smaller directories with success and... (11 Replies)
Discussion started by: uxlunatick
11 Replies

5. Shell Programming and Scripting

Script to remove all empty files within the directory structure?

Hi I need to write a shell script which basically searches for all the empty files within the directory structure, lists them before asking the user to confirm if they would like to delete them. If the user deletes the file then a notice would appear confirming the file is deleted. I've be... (5 Replies)
Discussion started by: cat123
5 Replies

6. Shell Programming and Scripting

How to traverse directory structure and sum size of files?

How do I write a bash or ruby or perl or groovy script to print all the files in my directory tree that are one-to-two years old, the size of each file, and the sum of file sizes and then delete them? I was using find . -atime +365 -exec rm '{}' \; but the problem was that I could not... (5 Replies)
Discussion started by: siegfried
5 Replies

7. Shell Programming and Scripting

Extract files from tar ball without directory structure

Hi, I have tar filw which has multiple directories which contain files. When i extract using tar -xf the directory structure also get extracted. I require only files and not directory structures as there will be overhead of moving the files again. So i searched here and got a solution but... (4 Replies)
Discussion started by: chetan.c
4 Replies

8. UNIX for Dummies Questions & Answers

Moving all files in a directory to another directory and archiving them

Hi All, i need to move all files in a directory to some other directory and need to archive them,,, Ex.. Source_Path/my_directory/ files in it are... acw.csv 123.txt bge.dat etc ..and we dont know how many files does my_directory contains and all are with different extensions ..so i need... (6 Replies)
Discussion started by: dssyadav
6 Replies

9. Shell Programming and Scripting

Parallel move keeping folder structure along with files in it

The below will move all the files in the directory dir to the destination using parallel and create a log, however will not keep them in the directory. I have tried mkdir -p but that does not seem to work or at least I can not seem to get it (as it deletes others files when I use it). What is the... (2 Replies)
Discussion started by: cmccabe
2 Replies
list child(1m)															    list child(1m)

NAME
list child - Displays a list of all the child pointers whose names match the specified child name SYNOPSIS
cdscp list child child-name [with attribute-name = attribute-value] ARGUMENTS
The full name of a specific child pointer. The last simple name can contain wildcard characters. The name of a particular attribute. The value of a particular attribute. DESCRIPTION
The list child command displays a list of all the child pointers whose names match the specified child name. The last simple name can con- tain wildcard characters. You can use a with attribute-name = attribute-value clause to limit output only to child pointers whose attributes have values equal to the specified values. A space must precede and follow the = (equals sign). Privilege Required You must have read permission to the directory that stores the child pointer. If you use a with attribute-name = attribute-value clause in the command, you also need read or test permission to the selected child pointers. NOTE
This command is replaced at Revision 1.1 by the dcecp command and may not be provided in future releases of DCE. EXAMPLE
The following command displays a list of all the child pointers named in the /.:/sales directory: cdscp> list child /.:/sales/* LIST CHILD /.../abc.com/sales AT 1991-10-15-15:56:00 Q1 Q2 Q3 Q4 RELATED INFORMATION
Commands: create child(1m), delete child(1m), show child(1m) list child(1m)
All times are GMT -4. The time now is 03:45 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy