Heyho!
I fiddled around with my RPi some more ad tested the forum, which reported every post as a flood. With a lot of digging I think the problem is the clock, which is reset to Wed Dec 31 17:00:00 MST 1969 at every reboot - at least that's the issue I want to have solved ;-)
We have the timesave feature, which I activated after setting the correct time. The timesave_file currently has "201410121620" in it.
crontab -l says:
Which is working. Time is saved every 5 minutes. Now the problem is: it's not restored. I already applied the latest commit to my timesave.sh (missing 'then'), so the script runs now, but date reports:
Now I messed around with the date command, and the problem is:
Now I'm pretty much out of ideas. What worked for me was setting date and time in two commands:
What I could do now is:
-seperate date and time in two files/seperate by line or something else
-possible introduce another variable in piratebox.conf
-do a lot of stuff with the timesave.sh script to work with the two files and set the time correctly
Another big question I'm having is: When is the timesave.sh script called to restore the clock?
mrd0ll4r
EDIT: I now understand why this issue comes up now:
In the months before today I had a spare ethernet cable and the RPi also had internet access. I guess it synced the time via NTP... but I don't have that cable anymore, and I just bought a USB power pack to go mobile with the whole thing.. so I still need the timesave :-/
I fiddled around with my RPi some more ad tested the forum, which reported every post as a flood. With a lot of digging I think the problem is the clock, which is reset to Wed Dec 31 17:00:00 MST 1969 at every reboot - at least that's the issue I want to have solved ;-)
We have the timesave feature, which I activated after setting the correct time. The timesave_file currently has "201410121620" in it.
crontab -l says:
blabla... */5 * * * * /opt/piratebox/bin/timesave.sh /opt/piratebox/conf/piratebox.conf save
Which is working. Time is saved every 5 minutes. Now the problem is: it's not restored. I already applied the latest commit to my timesave.sh (missing 'then'), so the script runs now, but date reports:
date: invalid date '201410121620'
Now I messed around with the date command, and the problem is:
date +%Y%m%d%H%M -s "201410121620" gives me "date: invalid date '2014.....'" date +%C%g%m%d%H%M -s "201410121620" gives me "date: invalid date '2014.....'" (version used in the timesave.sh script)
Now I'm pretty much out of ideas. What worked for me was setting date and time in two commands:
date +%Y%m%d -s 20141012 date +%T -s 16:58:00
What I could do now is:
-seperate date and time in two files/seperate by line or something else
-possible introduce another variable in piratebox.conf
-do a lot of stuff with the timesave.sh script to work with the two files and set the time correctly
Another big question I'm having is: When is the timesave.sh script called to restore the clock?
mrd0ll4r
EDIT: I now understand why this issue comes up now:
In the months before today I had a spare ethernet cable and the RPi also had internet access. I guess it synced the time via NTP... but I don't have that cable anymore, and I just bought a USB power pack to go mobile with the whole thing.. so I still need the timesave :-/