Need help about cron job and its capability

thanks ,raspberry pi usb hub will come soon ,will update again if my problem solved or not

for hub, 1a 5v charger will be sufficient as external power source to support my ssd ??

Not really surprising, since you said yourself that the internet access works all the time. It was therefore not to be expected that the script would have any effect.

You can try to activate permanent logging. You should then be able to see what happens before the ‘hard’ reboot.

persistent system logs:

dietpi-software uninstall 103 # uninstalls DIetPi-RAMlog
mkdir /var/log/journal # triggers systemd-journald logs to disk
reboot # required to finalise the RAMlog uninstall

Then you can check system logs via:

journalctl

which will then show as well logs from previous boot sessions. To limit the size, you can additionally e.g. apply the following:

mkdir -p /etc/systemd/journald.conf.d
cat << '_EOF_' > /etc/systemd/journald.conf.d/99-custom.conf
[Journal]
SystemMaxFiles=2
MaxFileSec=7day
_EOF_

This will limit logs to 14 days split across two journal files, so that with rotation you will always have between 7 and 14 days of logs available.

Please do not forget to restart the system once so that the logging can become active.

1 Like

thanks , i ordered raspberry pi usb hub and raspberry pi 27 watt pd charger ( 5v ,5a )

if it also fails then will try logging

thanks u for helping me ,i hope after that i will not face any problem

i was busy that why replying late

i would like to thank you Joulinar

using separate power source for ssd solved my problem

im using raspberry pi 0 2w ,raspberry pi usb hub 3 ,raspberry pi 27 watt pd charger ,raspberry official 64 gb A2 memory card

first i was using seperate power source for both pi and usb hub ,but now im powering pi 0 from one of the usb ( since its usb 3 a port ,it gives 0.9 a at 5v which is more than enough for pi 02w )

my pi 0 running butter smooth ,no lag
it was indeed power source which was creating problem

now i dont even need cronjob ,my pi doest loose connection

1 Like