---------- Post updated at 04:01 AM ---------- Previous update was at 02:57 AM ----------
Hi Don,
Your script is working fine ,i am getting the required files but i want to copy those files ,i have tried with another pipe to copy this but it throwing error
I can able to copy the files from s3(all files without using filter) to s3 using the below
Moderator's Comments:
Please use CODE tags to display code; not bold tags.
Thanks,
Mohan
Last edited by Don Cragun; 12-27-2015 at 11:58 PM..
Reason: Change B tags to CODE tags.
Hi Don,
Your script is working fine ,i am getting the required files but i want to copy those files ,i have tried with another pipe to copy this but it throwing error
I can able to copy the files from s3(all files without using filter) to s3 using the below
Moderator's Comments:
Please use CODE tags to display code; not bold tags.
Thanks,
Mohan
I will assume that the code marked in red above is on a line by itself and is not at the end of a line as shown...
I am always glad to hear that code that I have suggested is working. And, disappointed to see that many of the code improvements I suggested have been ignored.
Showing us a command that works is nice. Saying that when you modify it, you get an error without showing us what error(s) you get leaves us with a lot of work to try to duplicate your environment so we can figure out what error you might be getting (or just leaves us with little desire to try to help you). Since most of us volunteering our time to help you here don't have Amazon Web Server accounts, the only way for us to figure out what is going wrong in your environment is for you to explicitly show us exactly what errors you are getting. And, showing us exactly what is being produced by each step in your script so we can figure out what is happening to the data as it passes through your script and seeing where things are going wrong. If you want our help, please help us help you by giving us the data we need to help you analyze your problem(s).
It is immediately obvious that when you pipe a list of long format aws ls utility output to a command that is not a filter (i.e., does not read from standard input), the command at the start of the pipeline will be ignored (unless it contains a syntax error that kills the entire pipeline). Even if that did work; treating a line selected and printed by awk (such as:
as a the name of a file is clearly never going to work).
After looking up an aws cp man page, it would appear that you want to create an aws cp command something like:
using command substitution (not a pipeline) to add arguments to your aws cp command line. But, without actually seeing the exact format of the output produced by:
the error messages you got running the last script you showed us, and the exact output you get from:
(all in code tags), this is just wild speculation.
Hi Don,
Thanks for your advise ,Btw changed the code as you suggested ,Apologies for not publishing in the post .This below code working fine .I will check your script
Hi Don,
Thanks for your advise ,Btw changed the code as you suggested ,Apologies for not publishing in the post .This below code working fine .I will check your script
Thanks
You're welcome. (Note that hitting the Thanks button at the lower left corner of posts that you find helpful is also appreciated.)
Again, if you don't need the file /home/hadoop/file.txt elsewhere, your script will run faster if you don't create an unneeded file, write data to that file, and read the data back from that file. And feeding the output of an awk script into another awk script (especially when they're both using the same field separators) is almost always a waste of resources. For example:
will produce the same output as your script above, but run faster and consume fewer system resources.
Hi i need to keep todays files based on timestamp and archive the remaining files
ex:
Managerial_Country_PRD_20150907.csv
Managerial_Country_PRD_20150907.csv
Managerial_Country_PRD_20150906.csv
Managerial_Country_PRD_20150905.csv (6 Replies)
Hi,
I have requirement to list out files that are created after particular file.
ex. I have below files in my directory. I want to display files created after /dirdat/CG1/cg004440 file.
./dirdat/CG1/cg004438 09/07/14 0:44:05
./dirdat/CG1/cg004439 09/07/14 6:01:48 ... (3 Replies)
Hi,
ls -ltr
-rw-rw---- 1 user1 admins 5000032 Jan 20 17:11 M1120252_P004640.csv
Now i wish to cd to that folder amongst the below folders that would have log files for the date of the .csv file i.e. 20 Jan 17:11
ls -ltr
total 53616
drwxrwx--- 2 user1 admins 20840448 Jan 19... (4 Replies)
Hi All,
I have a large text file which is a combination of multiple files. This is what I used and it worked.
for i in /home/docs/text/*
do
cat $i >> Single_File
done
Now wondering, if there is a way to sort that single large file based on timestamps in ascending order. Text file... (11 Replies)
Hi,
I have a directory structure like below
Directoryname create time
d1 12:00
d2 12:05
d3 12:08
I want to read the directories based on timestamp.That is oldest directory must be read first and kick off certain process.
... (7 Replies)
I have lots of files in this format:
dvgrab-2003.06.29_15-30-24.mpg
The numbers represents the date and time (YYYY.MM.DD_HH-MM-SS)
How can I extract the dates from the filenames, and use the dates in the file timestamp?
I guess this can be done by using "find", "sed" and "touch"?
Can... (6 Replies)
I have a few log files which get generated on a daily basis..So, I need to pick only the ones which get generated for that particular day.
-rw-r--r-- 1 staff 510732676 Apr 7 22:01 test.log040711
-rwxrwxrwx 1 staff 2147482545 Apr 7 21:30 test.log.2
-rwxrwxrwx 1 staff 2147482581 Apr 7 19:26... (43 Replies)
Dear friends..
I have the below listing of files under a directory in unix
-rw-r--r-- 1 abc abc 263349631 Jun 1 11:18 CDLD_20110603032055.xml
-rw-r--r-- 1 abc abc 267918241 Jun 1 11:21 CDLD_20110603032104.xml
-rw-r--r-- 1 abc abc 257672513 Jun 3 10:41... (5 Replies)
Hi.,
My file name is of the format:
name_abc_20100531_142528.txt
where.,
my timestamp is of the format:
yyyymmdd_hhmmss
How to extract the date strring and time string into seperate variables in the shell script, after reading the file as the input?
I want to get the variables... (9 Replies)