- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- script with FTP
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
Forums
Discussions
Discussions
Discussions
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
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
12-28-2000 06:06 AM
12-28-2000 06:06 AM
Thanks in advance
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2000 06:20 AM
12-28-2000 06:20 AM
Re: script with FTP
You may use what's called a 'here document' like this:
ftp << EOF
open HOSTNAME
LOGIN_NAME
PASSWORD
binary
cd /tmp
put FILE
bye
EOF
Replace HOSTNAME, LOGIN_NAME, PASSWORD and FILE with appropriate data.
A 'here document' is a way to simulate the keyboard entry with text data located between matching labels (EOF in the example above)
man sh-posix will explain this (do a search for <<)
Best regards,
Dan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2000 06:38 AM
12-28-2000 06:38 AM
Re: script with FTP
It makes this much more flexible when inserting into a script.
Best of luck.
-tjh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2000 06:43 AM
12-28-2000 06:43 AM
Re: script with FTP
FTP is not really secure by this way,
have a look on this: see attached file
Happy new year
Pierre
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2000 07:32 AM
12-28-2000 07:32 AM
Re: script with FTP
But i don't want use FTP in a script, I want execute a script on a connection FTP (ex: idem .profile for rlogin or telnet)
Thanks in advance.
MF
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2000 07:51 AM
12-28-2000 07:51 AM
SolutionYour example (same .profile for rlogin and telnet) is impossible.
The reason is:
rlogin starts a shell while ftp doesn't.
As .profile is a shell executable, it cannot be used with non shell programs.
If you want to execute remote commands on a system, you could use 'remsh' to run any script or program, providing you're allowed to, and 'rcp' to copy files back and forth.
What do you want to do on the remote system?
Best regards,
Dan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2000 08:03 AM
12-28-2000 08:03 AM
Re: script with FTP
ok with you. in fact, I want execute a process on server HP when a user 'toto' this connect in ftp
thanks Dan.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2000 09:42 AM
12-28-2000 09:42 AM
Re: script with FTP
run ftpd -l this -l option should log to syslog the ftp connection and username.
Then have cron setup to grep for the said user/ftp in syslog and run the required script.
Hope it's of some help
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2000 12:31 AM
12-29-2000 12:31 AM
Re: script with FTP
Andreas Voss gave an example to redirect the logs to a different file. This would prevent syslog.log from becoming too large.
---QUOTE Andreas
this is not a single switch of ftpd messages but a solution that redirects ANY daemon facility (including ftpd) to a different file:
Change /etc/syslog.conf FROM:
mail.debug /var/adm/syslog/mail.log
*.info;mail.none /var/adm/syslog/syslog.log
*.alert /dev/console
*.alert root
*.emerg *
TO:
mail.debug /var/adm/syslog/mail.log
daemon.info;mail.none /var/adm/syslog/daemon.log
*.info;mail.none,daemon.none /var/adm/syslog/syslog.log
*.alert /dev/console
*.alert root
*.emerg *
(Note: delimiter MUST BE [TAB])
This will write daemon facilities into /var/adm/syslog/daemon.log.
After changes to /etc/syslog.conf reinitialize syslogd:
/sbin/init.d/syslogd stop
/sbin/init.d/syslogd start
---\QUOTE
Best regards,
Dan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2000 05:51 AM
12-29-2000 05:51 AM
Re: script with FTP
MF.