- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: "rsync" return response status for executing s...
Categories
Company
Local Language
Forums
Discussions
Knowledge Base
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Knowledge Base
Forums
Discussions
- Cloud Mentoring and Education
- Software - General
- HPE OneView
- HPE Ezmeral Software platform
- HPE OpsRamp
Knowledge Base
Discussions
Forums
Discussions
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
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
06-07-2007 06:24 PM
06-07-2007 06:24 PM
We use rsync scripts to push the contents to remote servers.
We want to execute some shell scripts on remote servers via ssh only if the contents of the target server directory changed with newer
contents.
Someone said that rsync returns some respose which needs to be captured when new contents are pushed to the target servers.
Once it is known that new contents are pushed then only the remote shell scripts should be executed via ssh.
Can someone explain how this can be done ?
Appreciate your help.
Thanks,
Shiv
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2007 07:51 PM
06-07-2007 07:51 PM
Re: "rsync" return response status for executing shell scripts remotely on remote servers via ssh
When you run your rsync with the -v optione redirect your STDOUT to a file.
Running grep on that file could give an indicaction of what has changed. Usually as a rule the output will give the following if nothing has changed otherwise list the files that have changed too.
building file list ... done
sent 22307 bytes received 16 bytes 8929.20 bytes/sec total size is 58029642 speedup is 2599.54
HTH
Andrew Y
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2007 08:12 PM
06-07-2007 08:12 PM
Re: "rsync" return response status for executing shell scripts remotely on remote servers via ssh
rsync handles pushing content only if its newer.
Just keep the ntp set properly on the server and use the -e ssh and --delete and stats options and it will work.
rsync checks the time and date stamp on files and directories.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2007 08:21 AM
06-08-2007 08:21 AM
Re: "rsync" return response status for executing shell scripts remotely on remote servers via ssh
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2007 06:29 AM
06-10-2007 06:29 AM
Re: "rsync" return response status for executing shell scripts remotely on remote servers via ssh
Do you also have any opinion on this ?
Best Regards,
Shiv
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2007 06:28 AM
06-11-2007 06:28 AM
Solutioncfengine is oriented toward synchronizing system admin data. If you are sync'ing
lots and lots of data (where rsyncs file
delta/diff region technology starts to cfengine is a good tool for this. It has the
explicit feature to synchronize a set of files and
then optionally execute shell scripts on the
target hosts only if synchronization actions were
required.
cfengine is oriented toward synchronizing system
admin data. If you are sync'ing lots and lots of
arbitrary data (MB's to GB's - where rsync's file
delta/diff region technology starts to come into
play) then it's not the appropriate tool - rsync
would be better there and you're back to parsing
rsync's stdout as suggested in the previous post.
It would be nice if rsync had a specific
exit status that could be used for this purpose
(i.e. success and work has been performed)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2007 06:19 PM
06-11-2007 06:19 PM
Re: "rsync" return response status for executing shell scripts remotely on remote servers via ssh
Use the following script as a basis for what it is you wish to do. It's not elegant, but the best I could come up with in 10 minutes. Although I am using bash it should work with most shells
#!/usr/local/bin/bash
if `/usr/local/bin/rsync -avcz --rsh="ssh" /app/live/linux/fmx/ appsrv01:/app/oracle/live/fmx > filelist.txt`
then
moved=""
for id in `grep -v "building file list" filelist.txt | grep -v "total size is"`
do
if [ "x$id" != "x" ]
then
moved="true"
fi
done
if [ "$moved" = "true" ]
then
ssh appsrv01 "echo 'It Worked'"
fi
else
echo "rynsc failed"
fi
Regards
Andrew Y