I have created a custom package, which updates the crontabs file.
This is how I add the entry in the post install script
define Package/alerts/postinst
#!/bin/sh
# check if we are on real system
if [ -z "$${IPKG_INSTROOT}" ]; then
echo "Adding to crontab"
if [ ! -f /etc/crontabs/root ]; then
touch /etc/crontabs/root
fi
echo "adding cron"
echo '*/1 * * * * alerts' >> /etc/crontabs/root
/etc/init.d/cron reload
echo "added cron"
fi
exit 0
endef
When I manually install the package separately it works fine.
But when I install it into the firmware (including the package in buildroot menuconfig), there is no crontab entry.
I think package is getting installed into this firmware before the crontab utility is.
Is there any way I can get this crontab entry working for my package?
P.S.:Not sure if I'm able to convey my question properly. Please let me know if more clarifications are necessary.