How can I repeat a command every interval of time , so that it will allow me to run commands for checking or monitoring directories ?
There is no need for a script, i need just a simple command to be executed in terminal.
You can use
Open Terminal and type :
change x to be the time you want .
For more help using the
For example : the following will list, every 60s, on the same Terminal, the contents of the Desktop directory so that you can know if any changes took place:
You can also use this command in terminal, apart from nux's answer :
This command will print output of
Use Ctrl+C to stop the process.
There is few drawbacks of
In the above circumstances this may appear as a better option.
Just wanted to pitch in to souravc and nux's answers:
Sounds like the ideal task for the
For example, if you would like to run a Python script on every Tuesday, 11 AM:
There are also some special names that replace the time, like
If you are monitoring the file system, then
In 1st terminal type this command :
Then in 2nd terminal, any command that affects the current directory,
Then in original terminal inotifywait will wake up and report the event
Or in a loop
You can create your own
First, open your
Second, paste these lines at the bottom of the file and save:
Third, either close and open again your terminal, or type:
Et voilà ! You can now use it like this:
you can use crontab. run the command
This will run your command every 10 minutes
This will run your command every 4 hours
Another possible solution
X number of times to repeat.
Y time to wait to repeat.