Administrator
|
Yes. You can do it.
You can write a bash script to read the file, see if the thing that you are looking for is true or false.
Then according to the value of that thing, the bash script can run the import job or whatever you want..
This is a basic scripting method. It can be done by standard if-else statements.
As for your question about cron,
normally cron is a scheduling thing.
But you can make it event driven as follows;
For example;
you can write a cron job to check a value in a file. You can make this cron job run in every second.. (or you can even daemonize it ->while(true) -> run)
So this job will check a value in a file, and if it finds it true, it runs whatever code you like.
Probably, the event is triggered by another code . When the event happens, this another code should modify that file and set the value, that your cron job is checking, to true.
As your cron job is checking the file every moment, it will see the value as true and it will run the code you like..
By using this kind of an approach, may make cron event driven.
This is just to show you the way. The approach that I explained above should be enhanced for being a true solution ofcourse..
|