crontab job for running every minute | overwrite file

 

1. create a bash script in linux :

vi /data/1

*************************

#!/bin/bash

mkdir /data

echo "test file for ">orig

for i in {000..010}

do

 yes| cp orig file$i

done

*************************

2.provide executable permisions
chmod +x /data/1

3.Add to cron:
run: "crontab -e " and enter below content:

* * * * * (cd /data && /bin/bash /data/1)

and save the file

4.verify the cron entries
crontab -l


5.restart the crond service:
systemctl restart crond

verify the scrip run everyminute.


No comments:

Post a Comment

Selenium firefox driver session fails with : Could not start a new session. Response code 500. Message: Expected browser binary location, but unable to find binary in default location,

 Error: With Firefox driver /gecko driver Could not start a new session. Response code 500. Message: Expected browser binary location, but u...