- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Script Help
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
Forums
Discussions
Discussions
Discussions
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
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
09-30-2003 05:46 AM
09-30-2003 05:46 AM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2003 05:48 AM
09-30-2003 05:48 AM
Re: Script Help
HTH
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2003 05:55 AM
09-30-2003 05:55 AM
Re: Script Help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2003 06:10 AM
09-30-2003 06:10 AM
Re: Script Help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2003 06:12 AM
09-30-2003 06:12 AM
Re: Script Help
Specifically method "mdtm" will return the last modify date for a remote file.
HTH
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2003 06:13 AM
09-30-2003 06:13 AM
Re: Script Help
use Net::FTP;
$ftp = Net::FTP->new("some.host.name", Debug => 0);
$ftp->login("anonymous",'-anonymous@');
$ftp->cwd("/pub");
$ftp->get("that.file");
$ftp->quit;
HTH
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2003 06:16 AM
09-30-2003 06:16 AM
SolutionWith this in mind you have to use some form of the "stat()".
This works, I thinkm in perl
#!/usr/bin/perl
use File::stat;
$MYFILE="MDSF0011.MDS";
$oldmodtime=stat($MYFILE)->mtime;
while(1){
$modtime=stat($MYFILE)->mtime;
if($modtime != $oldmodtime){
'path to run my script goes here';
$modtime=$oldmodtime;
}
sleep 60;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2003 07:48 AM
09-30-2003 07:48 AM
Re: Script Help
As I can see you have already got a solution for your problem but if you are interested, here is an alternative which not uses perl and which not need to run continous (you can for example run it from cron).
create a referencefile
> ref_file
update timestamp for ref_file from MDSF0011.MDS
touch -am -r MDSF0011.MDS ref_file
In your script
# chech if timestamp on MDSF0011.MDS has changed
if [ MDSF0011.MDS -nt ref_file ]
then
< do something >
# update timestamp for ref_file again
touch -am -r MDSF0011.MDS ref_file
fi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2003 01:41 AM
10-01-2003 01:41 AM