2
  • We have to use crontab -e to add a cronjob to crontab.
  • And crontab -r to remove cronjobs.
  • Here, no Copy & Paste not allowed.

I need to add a script to cron.daily, how to add?

Md Mahbubur Rahman
  • 424
  • 2
  • 7
  • 15

2 Answers2

7

Just drop an executable file (shell script or otherwise) in that folder and Bob's your uncle.

EEAA
  • 109,363
  • 18
  • 175
  • 245
1

Just place the script into the cron.daily directory; use cp to copy it from wherever it is to start with.

If you need script adding a line to an existing file the easiest way is

echo "Line to add" >> /path/to/file.txt

Which will append the new line to the end of the file.

DrStalker
  • 6,946
  • 24
  • 79
  • 107