- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to do Error Email if there is a Problem w/Scri...
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
тАО05-16-2001 07:01 AM
тАО05-16-2001 07:01 AM
My scripted worked great with the remote copy
thank you for you help.
I have it setup in cron to run at 4am every
day. However I have two questions.
1. Will it just copy over files on the target
with existing names? I want it to over
write with the new source file, so hopefully
the answer is yes.
2. How do I add some error checking like
syserr to my script below, do I add the email
to my cron job???:
FILES="/db21/backup/*.gz /db22/backup/*.gz /db23/backup/*.gz "
Here's my script:
for FILE in ${FILES}
do
rcp -p ${FILE} naropa:${FILE}
remsh naropa chown syb115:syb115 $FILE
done
Here's my cron:
0 4 * * * /var/adm/backup 2> /dev/null
~
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-16-2001 07:12 AM
тАО05-16-2001 07:12 AM
Re: How to do Error Email if there is a Problem w/Script
add if>then>else in your script for ctrl.log and if you have errors sen email with mailx or sendmail.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-16-2001 07:22 AM
тАО05-16-2001 07:22 AM
SolutionI happened to have a script that was extremely close so I added your emailing; it's commented out but remove the comments, set the proper addressee (ADDRESS). You will need to also set the variables GROUP and OWNER to change the ownerships of the remote files. The source and destination arrays will need to be set to your desired files. One improvement that I'll leave an an exercise for the reader is to determine the owner and group of the local file and use that data to set the values on the destination machine 'on the fly'. You may also need to add some PATH exports to run under cron.
Please see the attachment.
Clay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-16-2001 07:30 AM
тАО05-16-2001 07:30 AM
Re: How to do Error Email if there is a Problem w/Script
Sorry, Clay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-16-2001 08:59 AM
тАО05-16-2001 08:59 AM
Re: How to do Error Email if there is a Problem w/Script
||(pipepipe) if first did not work do second
&& if first did work do second
example:
rcp -p ${FILE} naropa:${FILE} || echo "Files did not go" | mailx ............
or
rcp -p ${FILE} naropa:${FILE} && echo "Files did go" | mailx .........
Hope this helps...
...jcd...