Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

HWCLOCK: Cannot access the hardware, running by crontab as root

Featured Replies

Hi, i get this error when i run the script by crontab. When I run manually, the script runs perfectly. crontab is executed by the command: "crontab -u root -e" To make sure the tasks are performed by the root user, but I still have the following error:

hwclock: Cannot access the Hardware Clock via any known method.
hwclock: Use the --debug option to see the details of our search for an access method.
Erro na sincronização
Wed 02 Oct 2019 08:04:11 AM -03

 This is the script:

#!/bin/bash
pingtest=$(ping -c 1 a.ntp.br > /dev/null 2>&1; echo $?);

if [[ $pingtest -eq 0 ]]; then
	systohc=$(/sbin/hwclock -f /dev/rtc1 -w; echo $?);

	if [[ $systohc -eq 0 ]]; then
		echo "SINCRONIZADO: SISTEMA PARA RTC"
		date
	else
		echo "Erro na sincronizacao"
		date
	fi
else
	hctosys=$(/sbin/hwclock -f /dev/rtc1 -s; echo $?);

	if [[ $hctosys -eq 0 ]]; then
		echo "SINCRONIZADO: RTC PARA SISTEMA"
		date
	else
		echo "Erro na sincronização"
		date
	fi
fi

and this is the contab, config by "crontab -u root -e" command:
 

*/30 * * * * /bin/bash /scripts/rtc/rtc.sh > /scripts/rtc/rtc.log 2>&1
@reboot /bin/bash /scripts/rtc/rtc.sh > /scripts/rtc/rtc.log 2>&1

Well, i dont understand why i got this error, if i am running the commands as root.

  • Author

 

After the system update, crontab was able to run the script as root. Now everything is working.

Armbian Linux 4.19.62-sunxi

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.