Script to search specific folders dates /mm/dd/ structure
Hi,
I have a script that handles a huge amount of log files from many machines and copies it into a SAN location with the following directory structure:
so for example
Now I am writing a bash script to search for files between to date ranges and I do not care currently which hosts I search in so a find statement like:
that increments the days then months is what I am writing. The user inputs a start date and an end date, e.g. 04.01.2011 and I strip out leading zeros and convert the day, month and year into variables. User can only search between 1 years so we are left with a start day, start month, end day, end month and a year variable.
I been trying for several hours on and off to write the logic to get this implemented but every time I think I figured it out and test my script I notice my logic is flowed. help. There must be a better way to do this then using while and if statements.
PS: doesnt matter if a day doesnt exists aka if I search for day 31 in February..
I am trying to write a script that cycles through a folder containing many folders and when inside each one it's supposed to copy all the .fna.gz files to a folder elsewhere if the file and the respective folder have the same name.
for fldr in /home/playground/genomes/* ; do
find .... (8 Replies)
I have a directory that is in the below order (the --- is not part of the directory tree, only there to help illustrate:
DATE --- main level
Folder1 --- level under DATE
plugin_out --- level under Folder1
variantCaller_out.40 --- level under plugin_out
001,002,003 --- level under... (3 Replies)
Hi,
I need to write a script the has to copy the files from folders and subfolders to the same folder structure located in another location.
Ex:
mainfolder1
file1,file2,file3 subfolder1(file1,etc) subfolder2(file1,etc) to another folder location of same folder structure.
rsync is not... (7 Replies)
Hi,
I've written a script to search for an Oracle ORA- error on a log file, print that line and the .trc file associated with it as well as the dateline of when I assumed the error occured. In most it is the first dateline previous to the error.
Unfortunately, this is not a fool proof script.... (2 Replies)
Hi
I want to copy the structure from one place to another.
-> cd /hol/;
-> find . -type d | cpio -pvdm /abc/cat;
while copying the structure I want to exclude some directories like test1 and Test.
I have read somewhere that this can be done with -prune option.
Could anyone... (2 Replies)
Hi,
I am currently writing a shell script to enter daily reoccurring jobs into the crontab. I want to be able to specify any two dates for which I want these daily jobs to run between.
Below is an example of what I need to be written to crontab.
# Give a start day of 21/10/2009 09:00... (2 Replies)
Hi All,
I have some folder that are named "FOLDERYYYYMM". I'm trying to piece together a .sh script that will look for the folder with the date. How can I get shell to see the date? (3 Replies)
Hello friends,
I am looking for a script or method that can display all the dates between any 2 given dates.
Input:
Date 1
290109
Date 2
010209
Output:
300109
310109
Please help me. Thanks. :):confused: (2 Replies)
Hi All,
I am trying to rsync some of the latest files from remote m/c to my local linux box.
Folder structure in my remote m/c looks like this
/pub/Nightly/Package/ROLL/WIN
/pub/Nightly/Package/SOLL/sol
/pub/Nightly/Package/SOLL/linux
Each of the folder contains gzip files which on daily... (0 Replies)
Hello Groups
I am trying to find out ways of comparing a value from a 'c' structure to a value in another 'C' structure. the 'C' structure can be a List or liked list as it contains lot many records.
if we loop it in both the structures it is going to consume time.
I am looking for a simple... (3 Replies)