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:
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:
In the future I would like to run this script periodically to archive files with more than 60 days old
You will have to use find and stat to look for files and their modification times and then take out the year from the last modification time to check for the existance of the archive directories and the move the files over.
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)
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)
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)
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)
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)
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)
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)
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)
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)