HPE GreenLake Administration
Operating System - HP-UX
1837672
Members
3668
Online
110117
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
Go to solution
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
06-02-2007 08:02 AM
06-02-2007 08:02 AM
Hi,
I want to execute a shell script on remote server from a source server. However, the script should execute on the target machine directory only if the contents in the target directory changes.
How to accomplish this ?
Thanks,
Shiv
I want to execute a shell script on remote server from a source server. However, the script should execute on the target machine directory only if the contents in the target directory changes.
How to accomplish this ?
Thanks,
Shiv
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2007 08:45 AM
06-02-2007 08:45 AM
Re: ssh
You can look for files with the current date/previous date time stamps(depending on when you want to check; like before 12AM or after 12AM)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2007 08:47 AM
06-02-2007 08:47 AM
Re: ssh
ssh -n hostname "command"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2007 10:33 AM
06-02-2007 10:33 AM
Solution
Hi Shiv:
Your script (on the target server) should simply exit if when run the directory it examines hasn't changed since the last time it interrogated it.
To accomplish something like this, you capture the last modification time of the target directory as file metadata. Then when you script runs, compare the modification time of the target directory to the reference file's timestamp.
To storing and comparing file timestamps use:
# touch -mr ref_file target
Compare the reference file and target directory ages with the '-ot' or '-nt' file test operators. See the manpages for 'touch' and for 'sh-posix' for more details.
Regards!
...JRF...
Your script (on the target server) should simply exit if when run the directory it examines hasn't changed since the last time it interrogated it.
To accomplish something like this, you capture the last modification time of the target directory as file metadata. Then when you script runs, compare the modification time of the target directory to the reference file's timestamp.
To storing and comparing file timestamps use:
# touch -mr ref_file target
Compare the reference file and target directory ages with the '-ot' or '-nt' file test operators. See the manpages for 'touch' and for 'sh-posix' for more details.
Regards!
...JRF...
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