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

Append to log and timestamped entries #127

Open
iosonogio opened this issue Mar 17, 2024 · 0 comments
Open

Append to log and timestamped entries #127

iosonogio opened this issue Mar 17, 2024 · 0 comments

Comments

@iosonogio
Copy link

iosonogio commented Mar 17, 2024

Sometimes it happens that the droplet-agent update script fails with an error. This is reported by cron, but without any detail about the nature of the error (only "exited with return code 1"), yet we are not able to find this detail in the droplet-agent.update.log file because this file is overwritten by the script every time it runs.

root@debianbox:~# cat /etc/cron.hourly/droplet-agent 
#!/bin/sh
/bin/bash /opt/digitalocean/droplet-agent/scripts/update.sh >/var/log/droplet-agent.update.log 2>&1

If there was a one-time error in the middle of the night, even though it may have solved in the subsequent runs, it would still be useful to know the reason of the error.

So my proposal is to have the update script append to the log file instead of overwriting it every time.

Moreover, I would like to propose to review the scripts so that timestamps are written in the log file as well, this is important for troubleshooting.

Than you!

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

No branches or pull requests

1 participant