#include <stdio.h>
#include <stdlib.h>
int main()
{
FILE *fp;
if ((fp = fopen("crontab_test.txt", "a+")) == NULL) {
perror ("crontab_test.txt failed");
exit (1);
}
fwrite ("hello\n", 6, 1, fp);
fclose (fp);
return (0);
}
46 9 * * * (cd /home/beyes/programming/crontab; ./crontab_test)
beyes@beyes-groad:~/programming/crontab$ ls
crontab_test crontab_test.c crontab_test.txt test.sh
$ cat crontab_test.txt
hello
crontab -r
#!/bin/sh
while true
do
./crontab_test
sleep 5
done
46 9 * * * (cd /home/beyes/programming/crontab; sh test.sh)
#!/bin/sh
while true
do
echo hello >> crontab_test.txt
sleep 5
done
欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) | Powered by Discuz! X3.2 |