|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
||||
|
||||
|
Seeking a linux shell script for to compare last modified file time.
Not sure if I should've posted this in Linux or scripts, but I'm basically looking for a bash shell script that will be able to check for a files properties to see if it has been modified within a set amount of time. This is because where I'm hosting my site doesn't allow FTP so my webcam updates to my own linux server, and then I'm going to run a cron script that checks the files properties and if it's been updated in the last 5 minutes SCP to my website.
I've been trying to do this as a bash shell script however I'm having trouble finding either the right function to get the date properties or parsing text. Right now I was approaching it by trying to do a stat -t on the file, however I have to either parse the output of stat or try and read it into an array variable. I could get this done a whole lot easier, by just using PHP with wget in my cron, but I figure a bash script would be cleaner (less files) and would also be pretty simple if I just could find out the proper function/syntax. -b
__________________
PostgreSQL, it's what's for dinner... |
|
#2
|
||||
|
||||
|
I figured it out, if anyone ever needs something like this here it is for posterity's sake (I'm a newb in linux shell scripting so feel free to point and laugh:
PHP Code:
|
|
#3
|
|||
|
|||
|
HI,
is there any ohter possibility to to see if a file has been modified within x minutes. On Linux I use find -cmin but under HP-UX -cmin is not available. Also stat -t is a good solution on Linux but again the comand is not available on HP-UX. Is there anybody that kwows a solution under HP-UX to find out if a file has been changed in the last x minutes. Thanks a lot ad |
![]() |
| Viewing: Dev Shed Forums > Web Site Management > Scripts > Seeking a linux shell script for to compare last modified file time. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|