mirror of
https://github.com/amidaware/tacticalrmm.git
synced 2026-04-26 15:05:57 +03:00
[GH-ISSUE #1363] Backup.sh directly overwrites itself #851
Labels
No labels
In Process
bug
bug
dev-triage
documentation
duplicate
enhancement
fixed
good first issue
help wanted
integration
invalid
pull-request
question
requires agent update
security
ui tweak
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tacticalrmm#851
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @azulskyknight on GitHub (Dec 6, 2022).
Original GitHub issue: https://github.com/amidaware/tacticalrmm/issues/1363
Originally assigned to: @dinger1986, @wh1te909 on GitHub.
As shown here:
if [ "${SCRIPT_VERSION}" -ne "${NEW_VER}" ]; then printf >&2 "${YELLOW}Old backup script detected, downloading and replacing with the latest version...${NC}\n" wget -q "${SCRIPT_URL}" -O backup.sh exec ${THIS_SCRIPT} fibackup.sh overwrites itself directly. This creates a risk of a bad download corrupting the script on execution as happened to my TRMM server Sunday with the release of v0.15.4. I didn't immediately notice this and it disabled the cronjob on my server halting backups effective Sunday night until I noticed this afternoon.
I suggest the script be enhanced to do as NiceGuyIT suggested in Discord, download to a temporary file, verify it and then copy it into place.
@silversword411 commented on GitHub (Dec 31, 2022):
https://discord.com/channels/736478043522072608/889513877124042762/1049758209507860640
@dinger1986 commented on GitHub (Dec 31, 2022):
That's what the script does at the moment. Shall work on it
@wh1te909 commented on GitHub (Mar 21, 2023):
I am actually removing the auto update feature of the backup script. Since the backup script is usually ran before an update, if it downloads and replaces itself with the newer version then the backup script will actually have the latest changes that are designed for the latest update, while the repo code hasn't been actually updated on the user's system yet, which could cause the backup script to fail as it references newer code that isn't yet on the system. Therefore the backup script must be manually managed and only replaced after the upgrade script has been ran.
@silversword411 commented on GitHub (Mar 22, 2023):
Should we update the docs so that the backup script is treated like the mesh troubleshooting script...just run from local file/as of last update?
https://docs.tacticalrmm.com/troubleshooting/#agents-not-installing-or-updating
Maybe update server_troubleshooting too...so it's running from last update files https://docs.tacticalrmm.com/troubleshooting/#server-troubleshooting-script