LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-16-2011, 02:44 PM   #1
cheltz
Member
 
Registered: Apr 2010
Posts: 62

Rep: Reputation: 2
ksh scripting


I need a way to script from the following file listing only the files dates Jan 13th and scp them to another server.

I can;'t think of a way to separate the July 13th files from the rest and then copy the files dates Jan 13 only off somewhere else.

I know how to scp and I can do it manually but I cannot think of a way to segregate the Jan 13th files and ignore the rest.

File listing:
rw-rw-rw-*** 1 eprprde* profile*** 22147536 Jan 13 21:00 xref.mjl_2011013210028
-rw-rw-rw-*** 1 eprprde* profile***** 566056 Jan 13 21:26 xref.mjl_2011013212620
-rw-rw-rw-*** 1 eprprde* profile*** 22067296 Jan 14 21:00 xref.mjl_2011014210034
-rw-rw-rw-** *1 eprprde* profile***** 328056 Jan 14 21:25 xref.mjl_2011014212552



If anyone has any ideas I would appreciate it.

Thanks

Last edited by cheltz; 01-16-2011 at 05:41 PM.
 
Old 01-16-2011, 02:51 PM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,823

Rep: Reputation: 611Reputation: 611Reputation: 611Reputation: 611Reputation: 611Reputation: 611
"2011013" looks like a date in the filename, though it's missing a digit. Assuming you mean JAN 13 not JUL 13, just scp *2011013* (or *20110113* - assuming there was a typo in your post).
 
1 members found this post helpful.
Old 01-16-2011, 05:41 PM   #3
cheltz
Member
 
Registered: Apr 2010
Posts: 62

Original Poster
Rep: Reputation: 2
Oh Geez ! Duh on my part. Thanks I never even noticed that.
 
Old 01-17-2011, 12:07 PM   #4
cheltz
Member
 
Registered: Apr 2010
Posts: 62

Original Poster
Rep: Reputation: 2
only one problem with the date in the file name.
the date is for example 2011013
If i used `date +%Y%d` I get 200113.
I don;t know how to get the "0" in there.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ksh scripting question unix1adm AIX 5 10-05-2010 08:10 AM
ksh scripting lqchangba AIX 5 07-04-2008 12:48 PM
ksh scripting lqchangba Linux - General 2 07-03-2008 06:01 AM
Three ksh scripting questions liguorir Linux - Software 2 10-22-2005 12:40 PM
some ksh scripting nabil Programming 1 03-03-2002 10:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration