reference
Prepare a virtual machine
kali comes with cron
Set up scheduled tasks
crontab -e #Edit cron task mode
Very annoying. He is using an editor of nano, not vim. You can press F1 to view the help.
alt+z can close the annoying prompt below, alt+x can close the above prompt
In the nano editor, you can exit and save the file by following these steps:
- Press Ctrl + X, which will display a bottom line.
- At the prompt, press the Y key to confirm saving changes.
- If you need to change the file name or select other options, follow the prompts. If you want to save and overwrite the original file, just press the Enter key.
- If you want to discard changes to the file without saving, you can press the N key or enter another option and then press the Enter key.
We write directly
* * * * * touch /root/1.txt
service crond restart #Restart the crontab service and use it to run cron successfully.
crontab -l View scheduled tasks