Search This Blog

Tuesday, August 22, 2017

Scheduling in linux to run the script every 2 minutes and 8 hours

step1:
creating new shell file script , and all commands to run in it

cat copy.sh

step2: editing the shell file to run the commands and  add #!/bin/sh in first line

vi copy.sh

#!/bin/sh
cp  <file from location to other location>
:wq!

step3 scheduling every 2 min and every 8 hours:

crowntab -e


*/2 * * * * <path of file to run eg: /tmp/copy.sh>
* */8 * * * <path of file to run eg: /tmp/copy.sh>

:wq!

No comments:

Post a Comment