Cron job cannot be used to schedule a job in seconds interval. i.e You cannot schedule a cron job to run every 5 seconds. The alternative is to write a shell script that uses sleep 5 command in it.
Or you can run it every minute by using the following
* * * * *
Create a shell script every-5-seconds.sh using bash while loop as shown below.
$ cat every-5-seconds.sh #!/bin/bash while true do /home/user/script.sh sleep 5 done
Now, execute this shell script in the background using nohup as shown below. This will keep executing the script even after you logout from your session. This will execute your backup.sh shell script every 5 seconds.
nohup ./every-5-seconds.sh &
Plus most hosts would forbid a 5 second script as you would suck up to many resources depending on what your doing. -- Affordable Web-Hosting, Reseller Hosting, Ventrilo, & Teamspeak services since 1999 @ »www.deadlyservers.com