Ad Widget

Collapse

File Age after File Exist

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • malachite
    Junior Member
    • Jul 2017
    • 1

    #1

    File Age after File Exist

    Hello everyone,
    I need to check the age of a file in a specific server folder. The file is a text file but the name can change. I know that the "vfs.file.time[file,<mode>]" key doesn't support wildcards so I thought of using the "UserParameter" and added a line similar to this in the agent configuration file
    "UserParameter=vsftp.check.older30mins,/bin/find /home/ftp/subdir/*.txt ! -newermt '30 minutes ago' | wc -l"

    I created an item and a trigger and everything works fine.

    I wanted to try to start the item after verifying the existence of the file using the key "vfs.dir.count[/home/ftp/subdir,^.*\.txt$,,file,,0,,,, ,]" but I can't correlate everything correctly. I tried creating master and dependent items but nothing. Can you help me?​
Working...