HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- My script
Operating System - HP-UX
1834162
Members
2890
Online
110064
Solutions
Forums
Categories
Company
Local Language
back
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
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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
08-20-2001 01:43 AM
08-20-2001 01:43 AM
My script
Hi All,
I have this script below (getaudit):-
# Requires file Hostnames.txt in the local directory. This file contains
# a list of system hostnames, one to a line.
#
if [ -f Hostnames.txt ]
then for host in `cat Hostnames.txt`
do ftp -n $host <<@END
user ******* ********
cd /tmp
asc
get audit
@END
echo $host
mv audit $host.audit
done
else echo $0: Cannot find Hostnames.txt
fi
Basically it collects a system audit file from each system in hostnames.txt and I would like to get more clear output/error messages from it. When it works, it echoes back the hostname but when it fails i don't get much information. I would like the output to look something like:-
Start of audot for
.
.
.
End of audit for
It's just to better understand the output when it scrolls down the screen, any help would be gratefully received.
Kind Regards,
Martyn
I have this script below (getaudit):-
# Requires file Hostnames.txt in the local directory. This file contains
# a list of system hostnames, one to a line.
#
if [ -f Hostnames.txt ]
then for host in `cat Hostnames.txt`
do ftp -n $host <<@END
user ******* ********
cd /tmp
asc
get audit
@END
echo $host
mv audit $host.audit
done
else echo $0: Cannot find Hostnames.txt
fi
Basically it collects a system audit file from each system in hostnames.txt and I would like to get more clear output/error messages from it. When it works, it echoes back the hostname but when it fails i don't get much information. I would like the output to look something like:-
.
.
.
End of audit for
It's just to better understand the output when it scrolls down the screen, any help would be gratefully received.
Kind Regards,
Martyn
Tough times don't last, tough people do!
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2001 02:04 AM
08-20-2001 02:04 AM
Re: My script
Hi Martyn,
On your ftp command line, append as follows:
ftp -n $host < ftp.check.log 2> ftp.check.err
...
...
!
then you can interrogate the log and err files for detailed analysis after each ftp command.
Rgds, Robin
On your ftp command line, append as follows:
ftp -n $host < ftp.check.log 2> ftp.check.err
...
...
!
then you can interrogate the log and err files for detailed analysis after each ftp command.
Rgds, Robin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2001 02:46 AM
08-20-2001 02:46 AM
Re: My script
Hi
You can write the stderr into file by saying
2>err.lst
ex:-
ls 2>err.lst write the errors generated by the command into the err.lst file
You can do something like that for all the commands where you want to capture the error messages.
...BPK...
You can write the stderr into file by saying
2>err.lst
ex:-
ls 2>err.lst write the errors generated by the command into the err.lst file
You can do something like that for all the commands where you want to capture the error messages.
...BPK...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2001 01:43 AM
08-21-2001 01:43 AM
Re: My script
Hi martyn,
Try the following, it may help u.FTPLOG=/tmp/ftplog
if [ -f host.name ]
then
for hostname in `cat host.name`
do
ftp -n $hostname < user ******* *******
cd /etc
ascii
get hosts
bye
EOF
echo $hostname
mv hosts $hostname.hosts
done 1>$FTPLOG 2>&1
else
echo "File name doesn't exists" >>$FTPLOG
fi
Regards
Joe.
Try the following, it may help u.FTPLOG=/tmp/ftplog
if [ -f host.name ]
then
for hostname in `cat host.name`
do
ftp -n $hostname <
cd /etc
ascii
get hosts
bye
EOF
echo $hostname
mv hosts $hostname.hosts
done 1>$FTPLOG 2>&1
else
echo "File name doesn't exists" >>$FTPLOG
fi
Regards
Joe.
Knowledge is wealth
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP