Page 1 of 1

Writing a crontab file

PostPosted: Jul 23rd, '25, 22:14
by laidlaws
(I must be losing my marbles. This is a simple task, that I have done several times before.)
I have a crontab file that I have saved as cron_root, as follows:
Code: Select all
0 */4 * * *    /usr/bin/rsnapshot hourly
50 23 * * *    /usr/bin/rsnapshot daily
00 23 * * 6    /usr/bin/rsnap/shot weekly

I want to enter the contents in /var/spool/cron/ to be executed by root.
Just copying and pasting the file shows its name, and not its contents.
Copying it line by liine into an empty directory isn't possible.
I probably need a file with "root" as the first line, in the directory /var/spool/cron, but I can't get the syntax right.
Any help appreciated.

Re: Writing a crontab file

PostPosted: Jul 23rd, '25, 23:26
by doktor5000
Not sure what your actual problem is. As root run
Code: Select all
crontab -e
and append those 3 lines and then write and quit.

Re: Writing a crontab file

PostPosted: Jul 24th, '25, 11:45
by laidlaws
Thanks, Doc. That answers my question.

Re: Writing a crontab file

PostPosted: Jul 24th, '25, 12:12
by isadora
Please don't forget to mark the topic [SOLVED], thanks ahead.