Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[Software] [SOLVED] cron job not working

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
kyon
Posts: 6
Joined: 2022-11-13 10:53

[Software] [SOLVED] cron job not working

#1 Post by kyon »

first of all I already search around about 1 day and can not find a useful solution, so I hope ask in forum would fix it XD

SYSTEM: debian bookwarm, which is the latest testing version of debian now
DESKTOP: KDE

my content with crontab -e

Code: Select all

@reboot cfw
@reboot python -m http.server 9191 --directory ~/Rules --bind 0.0.0.0
cfw is a symbollink I create in /usr/bin/cfw, if I run cfw in terminal by hand, it works perfectlly along with terminal session alive, but in cron it just not working
the second cron job start a python server, it works perfectlly
so I dont know where is the problem, please help me fix it, appreciated !

ADDITION INFO: cfw is ClashForWindows linux release, github link
Last edited by kyon on 2022-11-27 11:32, edited 1 time in total.

th0ni
Posts: 5
Joined: 2020-04-04 09:41

Re: [Software] cron job not working

#2 Post by th0ni »

Did you try the full path in crontab - /usr/bin/cfw ?

kyon
Posts: 6
Joined: 2022-11-13 10:53

Re: [Software] cron job not working

#3 Post by kyon »

th0ni wrote: 2022-11-13 13:07 Did you try the full path in crontab - /usr/bin/cfw ?
oh, yes, I forgot to say I already tried

Code: Select all

@reboot /usr/bin/cfw
@reboot /home/kyon/Apps/clash_for_windows/cfw 
/home/kyon/Apps/clash_for_windows/cfw is origin place of symbollink
both doesn't work

kyon
Posts: 6
Joined: 2022-11-13 10:53

Re: [Software] cron job not working

#4 Post by kyon »

I found a project call crontab-ui can easy check errors!, below is the cfw cronjob error msg

Code: Select all

[760:1114/105120.568101:ERROR:ozone_platform_x11.cc(247)] Missing X server or $DISPLAY
[760:1114/105120.568119:ERROR:env.cc(226)] The platform failed to initialize.  Exiting.
The futex facility returned an unexpected error code.
Aborted (core dumped)

reinob
Posts: 1196
Joined: 2014-06-30 11:42
Has thanked: 99 times
Been thanked: 47 times

Re: [Software] cron job not working

#5 Post by reinob »

You are trying to run a GUI (X) program, from a non-interactive session (cron), which is furthermore running as root instead of your user.

If you want to autostart a program when your user logs in X, there are many ways, including the use of ~/.config/autostart, which most DEs honor.

kyon
Posts: 6
Joined: 2022-11-13 10:53

Re: [Software] cron job not working

#6 Post by kyon »

reinob wrote: 2022-11-14 12:16 You are trying to run a GUI (X) program, from a non-interactive session (cron), which is furthermore running as root instead of your user.

If you want to autostart a program when your user logs in X, there are many ways, including the use of ~/.config/autostart, which most DEs honor.
thanks, I should put them into ~/.config/autostart

Post Reply