<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: FTP Files using sysdate in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-files-using-sysdate/m-p/4784620#M607097</link>
    <description>&lt;!--!*#--&gt;The answers given are all good, but allow me to summarize:&lt;BR /&gt;&lt;BR /&gt;1. Your question leaves out details, so we must make numerous assumptions in order to answer.&lt;BR /&gt;&lt;BR /&gt;Assumption 1: All files are already in a single directory on the source system&lt;BR /&gt;&lt;BR /&gt;Assumption 2: You're referring to an entire 24 hour period from the execution of the script, not just files exactly 24 hours old, but any file created WITHIN the last 24 hours&lt;BR /&gt;&lt;BR /&gt;Assumption 3: You're still growing as an admin and understanding the UNIX command set and the limitations of commands like ftp, and that's OK!  That's why we enjoy this forum!&lt;BR /&gt;&lt;BR /&gt;If the above assumptions are correct, then as an example, if you have 10 files in a single directory, 2 of which have been created in the last 24 hours, the following command might work without a script, but you might want to script this to provide error control and other things that the CLI cannot do on it's own:&lt;BR /&gt;&lt;BR /&gt;[/home/parkrc/tmp]# ls -lrt&lt;BR /&gt;-rw-r--r--   1 parkrc     sys         203553 Mar  7 17:00 ntlock.new&lt;BR /&gt;drwxr-xr-x   4 parkrc     sys           8192 Mar 16 11:25 Bonnie&lt;BR /&gt;-rw-r--r--   1 root       sys          61571 Mar 21 11:08 ts99&lt;BR /&gt;-rwxr-xr-x   1 root       sys         462533 Apr 27 09:30 escsi_diag.out.gz&lt;BR /&gt;-rw-r--r--   1 root       sys          55676 Apr 27 09:30 fcddiag.out.gz&lt;BR /&gt;-rwxr-xr-x   1 root       sys         466733 Apr 27 09:30 fclpdiag.out.gz&lt;BR /&gt;-rw-r--r--   1 root       sys          12686 Apr 27 09:30 syslog.log.gz&lt;BR /&gt;-rw-r--r--   1 root       sys            815 Apr 27 09:30 LMVinfo.out.gz&lt;BR /&gt;-rw-r--r--   1 root       sys              0 May  6 07:00 test1&lt;BR /&gt;-rw-r--r--   1 root       sys              0 May  6 11:04 test2&lt;BR /&gt;&lt;BR /&gt;[/home/parkrc/tmp]# find . -mtime -1 -print |awk -F "/" '{print $2}' |grep [0-z]&lt;BR /&gt;test1&lt;BR /&gt;test2&lt;BR /&gt;&lt;BR /&gt;(that verifies we're picking up the correct 2 files)&lt;BR /&gt;&lt;BR /&gt;From here, whether using ftp OR sftp, you'll have these filenames ready to either put in a file list (&amp;gt;/tmp/flist) for use in your script.  Various methods are available to setup a loop to pass each name to the "put" sub/ftp command.  This is the stuff good admins are made of, so it's a great opportunity to stretch your wings here and learn some shell coding!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Fri, 06 May 2011 17:17:49 GMT</pubDate>
    <dc:creator>RC Park</dc:creator>
    <dc:date>2011-05-06T17:17:49Z</dc:date>
    <item>
      <title>FTP Files using sysdate</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-files-using-sysdate/m-p/4784615#M607092</link>
      <description>Hi ALL &lt;BR /&gt;Is it possible to ftp only those files which is 1 day old  i mean sysdate -1. Is there any script.</description>
      <pubDate>Thu, 05 May 2011 09:49:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-files-using-sysdate/m-p/4784615#M607092</guid>
      <dc:creator>Linux 10g RAC on HP box</dc:creator>
      <dc:date>2011-05-05T09:49:15Z</dc:date>
    </item>
    <item>
      <title>Re: FTP Files using sysdate</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-files-using-sysdate/m-p/4784616#M607093</link>
      <description>are you looking for the files created or modified in the last day?&lt;BR /&gt;&lt;BR /&gt;if the latter, there is the -mtime option of find to accomplish this:&lt;BR /&gt;&lt;BR /&gt;# find -type f -mtime 1 -print&lt;BR /&gt;&lt;BR /&gt;look at the man page of find for more info&lt;BR /&gt;</description>
      <pubDate>Thu, 05 May 2011 10:13:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-files-using-sysdate/m-p/4784616#M607093</guid>
      <dc:creator>Viktor Balogh</dc:creator>
      <dc:date>2011-05-05T10:13:12Z</dc:date>
    </item>
    <item>
      <title>Re: FTP Files using sysdate</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-files-using-sysdate/m-p/4784617#M607094</link>
      <description>Hi thanx for the quick reply. I am talking about the files created.</description>
      <pubDate>Thu, 05 May 2011 10:42:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-files-using-sysdate/m-p/4784617#M607094</guid>
      <dc:creator>Linux 10g RAC on HP box</dc:creator>
      <dc:date>2011-05-05T10:42:24Z</dc:date>
    </item>
    <item>
      <title>Re: FTP Files using sysdate</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-files-using-sysdate/m-p/4784618#M607095</link>
      <description>&lt;BR /&gt;AFAIK there really is no way of scripting an FTP xfer that needs to know the date of the remote file, unless the name of the file contains the date.&lt;BR /&gt;&lt;BR /&gt;I'm assuming you want to go to some remote box via ftp and get files that were created yesterday.&lt;BR /&gt;&lt;BR /&gt;You could maybe go there and get an ls -Rl listing, bring that back to your local host, parse it and get a list of files you want, then go back out to the remote site and get the file.&lt;BR /&gt;&lt;BR /&gt;??&lt;BR /&gt;&lt;BR /&gt;-klb</description>
      <pubDate>Thu, 05 May 2011 16:07:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-files-using-sysdate/m-p/4784618#M607095</guid>
      <dc:creator>klb</dc:creator>
      <dc:date>2011-05-05T16:07:39Z</dc:date>
    </item>
    <item>
      <title>Re: FTP Files using sysdate</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-files-using-sysdate/m-p/4784619#M607096</link>
      <description>No.  The ftp command set if very limited and not a command interpreter, or shell.  So you accomplish this be moving files in and out of directories.  You have an INPUT directory for files just delivered by ftp, and a cron job to go and look for them once a day.  You have an OUTPUT directory and a cron job that calls ftp once a day to send out these files.&lt;BR /&gt;&lt;BR /&gt;Note that these files are exclusively used to ftp source and destination, and you don't do any other work in them.  For exmaple,&lt;BR /&gt;&lt;BR /&gt;/home/ftpuser/INPUT/&lt;BR /&gt;/home/ftpuser/OUTPUT/&lt;BR /&gt;&lt;BR /&gt;Everything that you are now asking to do, like :&lt;BR /&gt;&lt;BR /&gt;find /opt/application/work/files&lt;BR /&gt;&lt;BR /&gt;is performed in your own shell script that is called by cron.</description>
      <pubDate>Thu, 05 May 2011 16:31:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-files-using-sysdate/m-p/4784619#M607096</guid>
      <dc:creator>Michael Steele_2</dc:creator>
      <dc:date>2011-05-05T16:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: FTP Files using sysdate</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-files-using-sysdate/m-p/4784620#M607097</link>
      <description>&lt;!--!*#--&gt;The answers given are all good, but allow me to summarize:&lt;BR /&gt;&lt;BR /&gt;1. Your question leaves out details, so we must make numerous assumptions in order to answer.&lt;BR /&gt;&lt;BR /&gt;Assumption 1: All files are already in a single directory on the source system&lt;BR /&gt;&lt;BR /&gt;Assumption 2: You're referring to an entire 24 hour period from the execution of the script, not just files exactly 24 hours old, but any file created WITHIN the last 24 hours&lt;BR /&gt;&lt;BR /&gt;Assumption 3: You're still growing as an admin and understanding the UNIX command set and the limitations of commands like ftp, and that's OK!  That's why we enjoy this forum!&lt;BR /&gt;&lt;BR /&gt;If the above assumptions are correct, then as an example, if you have 10 files in a single directory, 2 of which have been created in the last 24 hours, the following command might work without a script, but you might want to script this to provide error control and other things that the CLI cannot do on it's own:&lt;BR /&gt;&lt;BR /&gt;[/home/parkrc/tmp]# ls -lrt&lt;BR /&gt;-rw-r--r--   1 parkrc     sys         203553 Mar  7 17:00 ntlock.new&lt;BR /&gt;drwxr-xr-x   4 parkrc     sys           8192 Mar 16 11:25 Bonnie&lt;BR /&gt;-rw-r--r--   1 root       sys          61571 Mar 21 11:08 ts99&lt;BR /&gt;-rwxr-xr-x   1 root       sys         462533 Apr 27 09:30 escsi_diag.out.gz&lt;BR /&gt;-rw-r--r--   1 root       sys          55676 Apr 27 09:30 fcddiag.out.gz&lt;BR /&gt;-rwxr-xr-x   1 root       sys         466733 Apr 27 09:30 fclpdiag.out.gz&lt;BR /&gt;-rw-r--r--   1 root       sys          12686 Apr 27 09:30 syslog.log.gz&lt;BR /&gt;-rw-r--r--   1 root       sys            815 Apr 27 09:30 LMVinfo.out.gz&lt;BR /&gt;-rw-r--r--   1 root       sys              0 May  6 07:00 test1&lt;BR /&gt;-rw-r--r--   1 root       sys              0 May  6 11:04 test2&lt;BR /&gt;&lt;BR /&gt;[/home/parkrc/tmp]# find . -mtime -1 -print |awk -F "/" '{print $2}' |grep [0-z]&lt;BR /&gt;test1&lt;BR /&gt;test2&lt;BR /&gt;&lt;BR /&gt;(that verifies we're picking up the correct 2 files)&lt;BR /&gt;&lt;BR /&gt;From here, whether using ftp OR sftp, you'll have these filenames ready to either put in a file list (&amp;gt;/tmp/flist) for use in your script.  Various methods are available to setup a loop to pass each name to the "put" sub/ftp command.  This is the stuff good admins are made of, so it's a great opportunity to stretch your wings here and learn some shell coding!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 06 May 2011 17:17:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-files-using-sysdate/m-p/4784620#M607097</guid>
      <dc:creator>RC Park</dc:creator>
      <dc:date>2011-05-06T17:17:49Z</dc:date>
    </item>
    <item>
      <title>Re: FTP Files using sysdate</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-files-using-sysdate/m-p/4784621#M607098</link>
      <description>Are you pushing or pulling the files?&lt;BR /&gt;If using put, you can simply use find(1) to collect a list and then script them in ftp as mentioned by Viktor.&lt;BR /&gt;&lt;BR /&gt;If using get, you'll need to do a "ls" first and then parse the output, then feed it back into ftp as mentioned by klb.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;I am talking about the files created.&lt;BR /&gt;&lt;BR /&gt;On Unix type systems, files don't have the creation date, only modification.</description>
      <pubDate>Sat, 07 May 2011 07:24:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-files-using-sysdate/m-p/4784621#M607098</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-05-07T07:24:16Z</dc:date>
    </item>
  </channel>
</rss>

