Sponsored Content
Top Forums Shell Programming and Scripting Moving files from one directory to another based on 2 date variables Post 302659951 by dsfreddie on Thursday 21st of June 2012 05:17:15 PM
Old 06-21-2012
Hi Corona,

I made the change you suggested.Here is what I see in logs now, (looks like soemthing is still wrong :-(

Quote:
++ cat /iis_dev_data3/wcc/cpmg/tmp/CPMGPERDynamicDateFile.txt
++ grep P_BUS_DATE
++ cut -d= -f2
+ export DYN_BUS_DATE=20120625
+ DYN_BUS_DATE=20120625
++ cat /iis_dev_data3/wcc/cpmg/tmp/CPMGPERDynamicDateFile.txt
++ grep P_SUB_DATE
++ cut -d= -f2
+ export P_SUB_DATE=20120603
+ P_SUB_DATE=20120603
+ Date_Current=20120625
+ Date_Previous=20120603
+ IFS=_
+ for EMPLOYEE in '/iis_dev_data3/wcc/cpmg/tmp/*.txt'
+ set -- /iis dev data3/wcc/cpmg/tmp/20120609 EMPLOYEE.txt
+ '[' /iis '>' 20120603 ']'
+ '[' /iis = 20120603 ']'
+ '[' /iis = 20120625 ']'
+ for EMPLOYEE in '/iis_dev_data3/wcc/cpmg/tmp/*.txt'
+ set -- /iis dev data3/wcc/cpmg/tmp/20120618 EMPLOYEE.txt
+ '[' /iis '>' 20120603 ']'
+ '[' /iis = 20120603 ']'
+ '[' /iis = 20120625 ']'
+ for EMPLOYEE in '/iis_dev_data3/wcc/cpmg/tmp/*.txt'
+ set -- /iis dev data3/wcc/cpmg/tmp/20120619 EMPLOYEE.txt
+ '[' /iis '>' 20120603 ']'
+ '[' /iis = 20120603 ']'
+ '[' /iis = 20120625 ']'
+ for EMPLOYEE in '/iis_dev_data3/wcc/cpmg/tmp/*.txt'
+ set -- /iis dev data3/wcc/cpmg/tmp/20120622 EMPLOYEE.txt
+ '[' /iis '>' 20120603 ']'
+ '[' /iis = 20120603 ']'
+ '[' /iis = 20120625 ']'
+ for EMPLOYEE in '/iis_dev_data3/wcc/cpmg/tmp/*.txt'
+ set -- /iis dev data3/wcc/cpmg/tmp/CallParam.txt
+ '[' /iis '>' 20120603 ']'
+ '[' /iis = 20120603 ']'
+ '[' /iis = 20120625 ']'
+ for EMPLOYEE in '/iis_dev_data3/wcc/cpmg/tmp/*.txt'
+ set -- /iis dev data3/wcc/cpmg/tmp/convertfuntionn.txt
+ '[' /iis '>' 20120603 ']'
+ '[' /iis = 20120603 ']'
+ '[' /iis = 20120625 ']'
Thanks
Freddie
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Moving files based on creation date

Howdy, I'm trying to figure out how to move multiple files based on their creation date. If anyone can enlighten me it would be most appreciated!! Thanks! :D (1 Reply)
Discussion started by: dgoyea
1 Replies

2. Shell Programming and Scripting

Moving file to directory based on condition.

Can any one help me to correct following script. I have 2 directories DropZone and ProcessZone. File pattern is *VEHDESCSUM*. Finding the 'no of files' in DropZone directory using ls *VEHDESCSUM* |wc -l If DropZone has more than one file or 0 files then exit 1 If DropZone has one file then... (2 Replies)
Discussion started by: ramanagh
2 Replies

3. Shell Programming and Scripting

Sorting Files by date and moving files in date order

I need to build a k shell script that will sort files in a directory where files appear like this "XXXX_2008021213.DAT. I need to sort by date in the filename and then move files by individual date to a working folder. concatenate the files in the working folder then start a process once... (2 Replies)
Discussion started by: rebel64
2 Replies

4. Shell Programming and Scripting

Creating date directory and moving files into that directory

I have list of files named file_username_051208_025233.log. Here 051208 is the date and 025233 is the time.I have to run thousands of files daily.I want to put all the files depending on the date of running into a date directory.Suppose if we run files today they should put into 05:Dec:08... (3 Replies)
Discussion started by: ravi030
3 Replies

5. Shell Programming and Scripting

Need script to select multiple files from archive directory based on the date range

hi all, here is the description to my problem. input parameters: $date1 & $date2 based on the range i need to select the archived files from the archived directory and moved them in to working directory. can u please help me in writing the code to select the multiple files based on the... (3 Replies)
Discussion started by: bbc17484
3 Replies

6. UNIX for Dummies Questions & Answers

Moving Directories Based on Modified date

Hi, How can I move directories (and all sub directories/files) from one directory to another based on the modified date of the directory? Currently the existing structure looks like this: /public_html/media/videos/tmb/34947/image1.jpg /public_html/media/videos/tmb/34947/image2.jpg ... (0 Replies)
Discussion started by: lbargers
0 Replies

7. Shell Programming and Scripting

Move files from one directory to another based on creation/modification date

Hi All, Really stuck up with a requirement where I need to move a file (Lets say date_Employee.txt--the date will have different date values like 20120612/20120613 etc) from one directory to another based on creation/modification dates. While visiting couple of posts, i could see we can... (3 Replies)
Discussion started by: dsfreddie
3 Replies

8. UNIX for Dummies Questions & Answers

Script moving files based on date

Hi, I need a script that moves files based on date to a folder. The folder should be created based on file date. Example is : Date file name ----- -------- Oct 08 07:39 10112012_073952.xls Oct 09 07:39 10112012_073952.xls Oct 10 07:39 ... (6 Replies)
Discussion started by: rockingvj
6 Replies

9. UNIX for Dummies Questions & Answers

Unable to find files, those can be present anywhere in the directory tree,based on its creation date

Hi I am unable to find files, those are present anywhere in the same directory tree, based on the creation date. I need to find the files with their path, as I need to create them in another location and move them. I need some help with a script that may do the job. Please help (2 Replies)
Discussion started by: sam192837465
2 Replies

10. UNIX for Beginners Questions & Answers

Searching for a files based on current date directory

Hi All, I've been trying to do some recursive searching but not been very successful. Can someone please help. Scenario: I have directory structure /dir1/dir2/dir3/ 2019/ 11/ 17 18 19 20 so what I want to do is run a script and as its 2019/11/18/ today it would go and only search... (3 Replies)
Discussion started by: israr75
3 Replies
LWP-RGET(1)						User Contributed Perl Documentation					       LWP-RGET(1)

NAME
lwp-rget - Retrieve web documents recursively SYNOPSIS
lwp-rget [--verbose] [--auth=USER:PASS] [--depth=N] [--hier] [--iis] [--keepext=mime/type[,mime/type]] [--limit=N] [--nospace] [--prefix=URL] [--referer=URL] [--sleep=N] [--tolower] <URL> lwp-rget --version DESCRIPTION
This program will retrieve a document and store it in a local file. It will follow any links found in the document and store these documents as well, patching links so that they refer to these local copies. This process continues until there are no more unvisited links or the process is stopped by the one or more of the limits which can be controlled by the command line arguments. This program is useful if you want to make a local copy of a collection of documents or want to do web reading off-line. All documents are stored as plain files in the current directory. The file names chosen are derived from the last component of URL paths. The options are: --auth=USER:PASn Set the authentication credentials to user "USER" and password "PASS" if any restricted parts of the web site are hit. If there are restricted parts of the web site and authentication credentials are not available, those pages will not be downloaded. --depth=n Limit the recursive level. Embedded images are always loaded, even if they fall outside the --depth. This means that one can use --depth=0 in order to fetch a single document together with all inline graphics. The default depth is 5. --hier Download files into a hierarchy that mimics the web site structure. The default is to put all files in the current directory. --referer=URI Set the value of the Referer header for the initial request. The special value "NONE" can be used to suppress the Referer header in any of subsequent requests. The Referer header will always be suppressed in all normal "http" requests if the referring page was transmitted over "https" as recommended in RFC 2616. --iis Sends an "Accept: */*" on all URL requests as a workaround for a bug in IIS 2.0. If no Accept MIME header is present, IIS 2.0 returns with a "406 No acceptable objects were found" error. Also converts any back slashes (\) in URLs to forward slashes (/). --keepext=mime/type[,mime/type] Keeps the current extension for the list MIME types. Useful when downloading text/plain documents that shouldn't all be translated to *.txt files. --limit=n Limit the number of documents to get. The default limit is 50. --nospace Changes spaces in all URLs to underscore characters (_). Useful when downloading files from sites serving URLs with spaces in them. Does not remove spaces from fragments, e.g., "file.html#somewhere in here". --prefix=url_prefix Limit the links to follow. Only URLs that start the prefix string are followed. The default prefix is set as the "directory" of the initial URL to follow. For instance if we start lwp-rget with the URL "http://www.sn.no/foo/bar.html", then prefix will be set to "http://www.sn.no/foo/". Use "--prefix=''" if you don't want the fetching to be limited by any prefix. --sleep=n Sleep n seconds before retrieving each document. This options allows you to go slowly, not loading the server you visiting too much. --tolower Translates all links to lowercase. Useful when downloading files from IIS since it does not serve files in a case sensitive manner. --verbose Make more noise while running. --quiet Don't make any noise. --version Print program version number and quit. --help Print the usage message and quit. Before the program exits the name of the file, where the initial URL is stored, is printed on stdout. All used filenames are also printed on stderr as they are loaded. This printing can be suppressed with the --quiet option. SEE ALSO
lwp-request, LWP AUTHOR
Gisle Aas <aas@sn.no> perl v5.12.1 2009-06-15 LWP-RGET(1)
All times are GMT -4. The time now is 06:04 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy