Jun 192013
 

Sometimes it’s useful to write a bash script that do something like “Do this job, if it’s still running after XX second kill it”, how to implement this in a normal bash environment ?

Nothing simpler: Use the timeout shell command to achieve this.
From its info page:

timeout runs the given COMMAND and kills it if it is still running after the specified time interval

Let’s see how to use it.

Continue reading »

flattr this!

Oct 172012
 

In a former article I’ve talked about the commands cron and crontab  that are the standard way to schedule recurring things on a Gnu/Linux system.

But sometimes you need to do one thing at a specific date and time for just one time, and for these tasks the best option is to use at, another way to use at is to run a command later when the computer won’t be busy.

Or another reason could be that you want to run a command that requires a lot of time to end and you have to disconnect from that server, at could be used in this situation, but for these task i suggest to take a look at the articles on how to run commands on background and the utility screen

Continue reading »

flattr this!