- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- About shell script
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
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
тАО07-29-2008 08:16 PM
тАО07-29-2008 08:16 PM
About shell script
1. I use the command "comp" to compare the difference of two directory , then output will be write (appending) to a log,
eg. comp directory1 directory2 >> /tmp/comp_log
it is OK , but if I want when write the output to the log , it also write down the current time and date so that I can more easily to trace the error , can advise what can i do ?
2. I have a ftp script to a file as below
ftp ip <
mput *
bye
EOF
it is OK , it ftp all files to /tmp , but if I want to log down all file name that HAVE transferred , can advise what can i do ? thx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-29-2008 08:57 PM
тАО07-29-2008 08:57 PM
Re: About shell script
date >> /tmp/comp_log
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-29-2008 09:02 PM
тАО07-29-2008 09:02 PM
Re: About shell script
the comp would write the error when have difference and do not write anything when no difference , I only want it write down the time when have error , what can i do ? thx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-29-2008 09:06 PM
тАО07-29-2008 09:06 PM
Re: About shell script
for that you can check exit status (echo $?) of comp process and accordingly you append/not date output in log file!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-30-2008 01:15 AM
тАО07-30-2008 01:15 AM
Re: About shell script
it is OK for my first problem , but I can't solve the second problem , please help , thx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-30-2008 01:26 AM
тАО07-30-2008 01:26 AM
Re: About shell script
try to write something on the top of your ftp script like;
#!/usr/bin/ksh
exec 1>/tmp/ftp_transferlog 2>&1
set -o xtrace
Good Luck,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-30-2008 04:19 AM
тАО07-30-2008 04:19 AM
Re: About shell script
If you want to log the files transfered, capture the session's dialog in a log file and parse the output. Change your script, as posted, to look like:
#!/usr/bin/sh
typeset LOG=/var/tmp/output.$$
ftp -inv<
cd /tmp
mput *
bye
EOF!
echo "See: '${LOG}'"
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-14-2008 02:57 AM
тАО08-14-2008 02:57 AM
Re: About shell script
I tried Cem Tugrul and James R. Ferguson 's method , it can log all process that in the ftp process , what I would like is to log the transferred file only , not the messages of the transfer process , can advise what can i do ? thx
log
=======
Connected to 192.168.0.1
220 (vsFTPd 2.0.5)
530 Please login with USER and PASS.
530 Please login with USER and PASS.
Interactive mode on.
Passive mode off.
530 Please login with USER and PASS.
Local directory now /ora
530 Please login with USER and PASS.
mput aaa? 530 Please login with USER and PASS.
mput bbb? 530 Please login with USER and PASS.
mput ccc? 530 Please login with USER and PASS.
Please login with USER and PASS.
Please login with USER and PASS.
"
"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-14-2008 04:16 AM
тАО08-14-2008 04:16 AM
Re: About shell script
> what I would like is to log the transferred file only , not the messages of the transfer process
What's so hard about parsing the output file of the FTP, as I suggested, and logging (appending) successful transfer information to a *separate* log?
Regards!
...JRF...