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