Edit the user crontab
crontab -e
Then add the following lines
0 * * * * dd if=/dev/random of=/tmp/myfile1.dat bs=$(( 1024 * 1024 * 1024 )) count=2
0 * * * * dd if=/dev/zero of=/tmp/myfile2.dat bs=$(( 1024 * 1024 * 1024 )) count=2
Or edit /etc/crontab and substitute user_to_run_as with the user you want to run the command as
0 * * * * user_to_run_as dd if=/dev/random of=/tmp/myfile1.dat bs=$(( 1024 * 1024 * 1024 )) count=2
0 * * * * user_to_run_as dd if=/dev/zero of=/tmp/myfile2.dat bs=$(( 1024 * 1024 * 1024 )) count=2
I tried it out and using /dev/random doesn't give you an exact file size. "Why does dd from /dev/random give different file sizes?" seems to give the explanation for this
dd
and Cron… What have you already tried?