Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is Crontab working? #77

Closed
tjuanma opened this issue Jan 27, 2021 · 16 comments
Closed

Is Crontab working? #77

tjuanma opened this issue Jan 27, 2021 · 16 comments
Labels

Comments

@tjuanma
Copy link

tjuanma commented Jan 27, 2021

I would like to make a reboot every midnight by cron.

To do that I'm trying with:

0 0 * * * /tmp/sd/yi-hack/www/reboot.sh
0 0 * * * /sbin/reboot

But no one of those are working.

Doing that straight from SSH makes my camera reboot properly so i think that cron is not working as expected, is that possible?

Running "ps" i can't find the cron process working.

the "root" file where crons saves, updates properly after changing the config and reboot manually the camera, but cron never get executed.

Help please.

Another way to schedule a reboot?

@tjuanma tjuanma changed the title Crontab is working? Is Crontab working? Jan 27, 2021
@roleoroleo
Copy link
Owner

It should work.
I'm using it.
If you run manually the command, does it work?
/home/yi-hack/usr/sbin/crond -c /var/spool/cron/crontabs/

@mcanteri
Copy link

It should work.
I'm using it.
If you run manually the command, does it work?
/home/yi-hack/usr/sbin/crond -c /var/spool/cron/crontabs/

Hi @roleoroleo,
In the 0.1.3 release there isn't that executable.
I was trying to use that feature in the lasts days but I found too that isn't working.
I thought about a daily reboot too since I keep finding a core file in the record folder and via rstp HA from time to time trace errors.
After putting the executable in usr/sbin folder and tried your command I can see the crond running:
20803 root 860 S crond -c /var/spool/cron/crontabs/
So it is just the executable missing.

@roleoroleo
Copy link
Owner

Sorry.
The change is committed but not released.
I have to arrange a new release.

@roleoroleo
Copy link
Owner

0.1.4 released.
Pay attention to the breaking change.

@WalkingDot
Copy link
Contributor

If I'm using the web interface to add a cronjob, only the minute value get saved.

I used this example:
0 2 * * * echo 'This is a test' > /tmp/sd/record/crontest.txt

Is saved in the text field:
0

@roleoroleo
Copy link
Owner

roleoroleo commented May 22, 2021

Sorry, I added a new bug in the last commit.
Please overwrite the file /home/yi-hack/www/cgi-bin/set_configs.sh
with this:
https://github.com/roleoroleo/yi-hack-MStar/blob/master/src/www/httpd/cgi-bin/set_configs.sh
https://github.com/roleoroleo/yi-hack-Allwinner-v2/blob/master/src/www/httpd/cgi-bin/set_configs.sh

@WalkingDot
Copy link
Contributor

WalkingDot commented May 22, 2021

Updated comment:

Thank you! I have used:
https://github.com/roleoroleo/yi-hack-Allwinner-v2/blob/master/src/www/httpd/cgi-bin/set_configs.sh

@WalkingDot
Copy link
Contributor

i wanted to add a second cronjob, when I save only the first entry is added.

0 1 * * * echo 'test1' > /tmp/sd/record/crontest.txt
0 2 * * * echo 'test2' > /tmp/sd/record/crontest.txt

@roleoroleo
Copy link
Owner

You are right.
I need to check it.

@roleoroleo
Copy link
Owner

roleoroleo commented May 28, 2021

Maybe I fixed it with this commit:
roleoroleo/yi-hack-MStar@c5ba66b
I will port asap on allwinner-v2

@roleoroleo
Copy link
Owner

Here it is:
39d7924

@WalkingDot
Copy link
Contributor

WalkingDot commented Jun 21, 2021

Is it maybe possible to update the crontab version? The @reboot function isn't working:
@reboot echo 'test' > /tmp/sd/record/crontest.txt

This would allow to run scripts/binaries on boot, without changing anything of your code. And after a hack-upgrade these autostarts will still remain.

@roleoroleo
Copy link
Owner

This cron is part of the busybox.
If the syntax you used doesn't work I can't update it, sorry.
But if you want to run somehing at boot you could use startup.sh.
Check the last lines of system.sh: https://github.com/roleoroleo/yi-hack-Allwinner-v2/blob/master/src/static/static/yi-hack/script/system.sh

@WalkingDot
Copy link
Contributor

Thanks, your suggestion to the startup.sh helps me a lot :-)

@sretalla
Copy link

In yi-hack-5 I see the location of the reboot binary as /home/base/tools/reboot

I am able to run it from ssh like that.

@stale
Copy link

stale bot commented Dec 9, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants