I write a shell script below to add a job to cron.
#!/bin/sh
touch date.cron
echo '*/3 * * * * /usr/sbin/ntpdate 192.168.2.3' >date.cron
crontab date.cron
rm date.cron
But I don’t want to create the file date.cron. How can I add the job directly without creating the file. Any suggestions?
1 Answer