Results 1 to 2 of 2
Ok so this is the issue i am faced with i have approximately 5 directories containing thousands of scripts. I'm trying to identify all the scripts that are obsolete or ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 12-20-2011 #1
- Join Date
- Jul 2011
Ok so this is the issue i am faced with i have approximately 5 directories containing thousands of scripts. I'm trying to identify all the scripts that are obsolete or have not been run in a while. I can traverse the crontab and get the main scripts and their dependencies from that and then traverse the script with python and regular expression to find the dependencies.
The problem exists is for the on demand scripts or scripts that aren't in the crontab how would you find which ones those were? I'm more so looking for ideas on how to tell when a script was ran last. Normally you could scan output but not everything has output which is causing this problem. We are running RHEL 5 so any ideas on how to do this would be great.
- 12-21-2011 #2
The filesystem records the access time for each file. Provided you've not done anything to access the files, then their last use time should be recorded. I have no idea how to do this, however, as I've never needed to use the information.
All I know is that the access timestamp is often turned off, so checking that it's still enabled would be a good place to start. Take a look in the /etc/fstab file and look at the mount options for the partition containing the scripts. If it contains the flag 'noatime' among it's other flags (it'll probably be immediately after the 'defaults' flag, if that's present). If the flag is present, then you have no way of knowing when a script file was last opened and its contents read.Linux user #126863 - see http://linuxcounter.net/