Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Cron job doesn't work
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
doskanoness
n00b
n00b


Joined: 06 Oct 2021
Posts: 45

PostPosted: Thu Nov 11, 2021 6:15 am    Post subject: Cron job doesn't work Reply with quote

Hi, I have an issue with not working a cron job. I have a Gentoo installation with ZFS on root. Here's content of the file /etc/sanoid/sanoid.conf:

Code:
[bpool]
        use_template = production
        recursive = yes
[rpool]
        use_template = production
        recursive = yes
[rpool/home/doskanoness]
        use_template = backup

#############################
# templates below this line #
#############################

[template_production]
        frequently = 0
        hourly = 36
        daily = 30
        monthly = 3
        yearly = 0
        autosnap = yes
        autoprune = yes

[template_backup]
        frequently = 30
        hourly = 30
        daily = 90
        monthly = 12
        yearly = 0
        autosnap = yes
        autoprune = yes

[template_ignore]
        autoprune = no
        autosnap = no
        monitor = no


and the content of file /etc/cron.d/sanoid:
Code:

* * * * * root TZ=UTC /usr/bin/sanoid --cron


/etc/cron.d/sanoid file has the 0644 permissions and is owned by root. rc-service cronie status shows that cronie service is running. I made a test cron job

Code:
* * * * * root echo dupa > /tmp/dupa.txt


and it seems like cron is working.

Code:
┌─[doskanoness@gentoo] - [~] - [2021-11-11 07:12:34]
└─[0] <> ls /tmp                                                                                                                                                              ⚡[▶▶▶▶▶▶▶▶▶▷]
dbus-udP2C8ZH5z         MozillaUpdateLock-6AFDA46A1A8AD48  sddm-:0-dcsceN                                 Temp-51b1c6a1-9a06-4485-b320-e3b849c6d7e4  xauth-1000-_0
hsperfdata_doskanoness  plasma-csd-generator.vMbsCC        sddm-auth8c0cd864-f049-4951-bbb9-c6a5b6fb89e6  UpdateLock-9238613B8C3D2579
┌─[doskanoness@gentoo] - [~] - [2021-11-11 07:12:58]
└─[0] <> ls /tmp/                                                                                                                                                             ⚡[▶▶▶▶▶▶▶▶▶▷]
dbus-udP2C8ZH5z=                                plasma-csd-generator.vMbsCC/                    UpdateLock-9238613B8C3D2579                   
dupa.txt                                        sddm-:0-dcsceN=                                 xauth-1000-_0                                 
hsperfdata_doskanoness/                         sddm-auth8c0cd864-f049-4951-bbb9-c6a5b6fb89e6=                                               
MozillaUpdateLock-6AFDA46A1A8AD48               Temp-51b1c6a1-9a06-4485-b320-e3b849c6d7e4/
┌─[doskanoness@gentoo] - [~] - [2021-11-11 07:14:00]
└─[130] <> cat /tmp/dupa.txt                                                                                                                                                  ⚡[▶▶▶▶▶▶▶▶▶▷]
dupa


I have system timezone set to the Europe/Warsaw. Any help is appreciated.


Last edited by doskanoness on Thu Nov 11, 2021 5:07 pm; edited 1 time in total
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3879

PostPosted: Thu Nov 11, 2021 4:00 pm    Post subject: Reply with quote

Hi
plz try
Code:

grep -i sanoid /var/log/cron.log

There should be hints there.
ALSO
* * * * means run the cronjob every minute continuously.
Is this how it is done?
Is
TZ=UTC /usr/bin/sanoid --cron

a correct invocation?
Try manually runnung it from a terminal.
_________________
:)
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21619

PostPosted: Thu Nov 11, 2021 4:06 pm    Post subject: Reply with quote

In what way is the cron job not working? Have you tried recharging your shell prompt?
Back to top
View user's profile Send private message
doskanoness
n00b
n00b


Joined: 06 Oct 2021
Posts: 45

PostPosted: Thu Nov 11, 2021 5:07 pm    Post subject: Reply with quote

I finally solved it. The problem was in the /etc/cron.d/sanoid file. That file contained a non-ASCII character.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum