- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: ftp files one day old
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-02-2009 06:09 AM
тАО04-02-2009 06:09 AM
ftp files one day old
cd /source dir
ftp -n -v -i destination server << EOD
user username password
cd /destination dir
umask 111
find /destination dir -type f -mtime +1 -name "*.dat" -exec mput {} \;
EOD
I keep getting invalid command when I try and run this script anyone any ideas?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-02-2009 06:13 AM
тАО04-02-2009 06:13 AM
Re: ftp files one day old
Yes. You are trying to run a 'find' command from within an FTP Session. I seriously doubt that this will work.
I have not see an FTP program that will allow that.
You will have to figure out some other way to feed your list of files into FTP.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-02-2009 06:19 AM
тАО04-02-2009 06:19 AM
Re: ftp files one day old
FTP has no idea what to do with 'find...'.
You need to find() the files matching your criteria and pass their names to your script. I would do something like:
MYFILES=$(find /path -type f -mtime +1 -name "*.dat")
{ echo "open myserver
user acctname acctpass
mput ${MYFILES}
close"
} | ftp -i -n -v
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-02-2009 06:58 AM
тАО04-02-2009 06:58 AM
Re: ftp files one day old
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-02-2009 07:11 AM
тАО04-02-2009 07:11 AM
Re: ftp files one day old
A loop to feed the script I suggested is certainly one way.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-02-2009 11:45 AM
тАО04-02-2009 11:45 AM
Re: ftp files one day old
You do realize that we have no idea what your
script actually does in your environment,
right?
> MYFILES=$(find /path [...]
And what did you get in MYFILES?
echo "${MYFILES}"
And we don't really _know_ anything about
what _your_ script is (or does), because
you haven't _showed_ us anything.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-03-2009 12:49 AM
тАО04-03-2009 12:49 AM
Re: ftp files one day old
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-03-2009 01:06 AM
тАО04-03-2009 01:06 AM
Re: ftp files one day old
$(find /destination-dir -type f -mtime +1 -name "*.dat" -exec echo mput {} +)
EOD
>There is more than one file of the same time stamp
If you do that find outside do you get more than one? -mtime +1 will give all files modified >= 48 hours ago. Unless you used UNIX95=FIDDLE_WITH_FIND_TIMES:
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1306285
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-03-2009 01:13 AM
тАО04-03-2009 01:13 AM
Re: ftp files one day old
Please assign some points who give there valuable time for your problem.
To know how to assign points please go through the below link.
http://forums13.itrc.hp.com/service/forums/helptips.do?#33
Suraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-03-2009 05:19 AM
тАО04-03-2009 05:19 AM