Traccar tools

Slawek4 years ago

Simply script for managing Traccar system. Everyone can feel free about modifications and improvements, give here some smart solution.

https://mega.nz/file/O5kC0IhI#Xxp6c_rx0m63FRPcVP3nzB65nJKdkcf42HzP_trAC1I

Anton Tananaev4 years ago

You should probably explain a bit more what your tool does.

Slawek4 years ago

tt.jpg

I think all is simple,
** 1) Uninstall Traccar v4.1 and later

** 2) Uninstall Traccar v4.0 and earlier

** 3) Fresh Install Traccar
Checking last ver, ask about download and ask about installation, if yes install

** 4) Upgrade Traccar (Back up and restore config files)
Checking last ver. ask about download and ask about installation, if yes
Make backup dir in '/root/backup/'
Archive files *.xml *.conf from '/opt/traccar/conf' to '/root/backup/'
Archive files *.db from '/opt/traccar/data' to '/root/backup/'
Archive '/etc/systemd/system/traccar.service' to '/root/backup/'
Installation and restore files

** 5) Restart Traccar v4.1 and later

** 6) Show log (q to exit)

** 7) Traccar service status (q to exit)

** 8) Check latest Traccar version

Slawek4 years ago

need root permissions of course

laudarch4 years ago

Add to git?

jay4 years ago

Hi Slawek. With this tool. Firstly must we install mysql and config it, like creating traccar dbase. And then use this tool. and secondly I have tried this tool by uninstalling and reinstalling, works like a charm.

Slawek4 years ago

New ver

Small change, stopping traccar service before copy config files and *db during upgrade

https://mega.nz/file/Xt8ExTxY#XpImCmxGZsEHlBW79l-6hkEypcfJxmkOAEdVu38hSnk

Slawek4 years ago

New ver

Some people could have custom default.xml
Update come with new protocals and some improvements in this file.
New ver of this script make backup default.xml and traccar.xml files in to /root/backup/ directory, but during update (opt 4.) restore only traccar.xml
If you have custom default.xml you must restore this file manually from /root/backup/ to /opt/traccar/conf directory and restart service
This ver of script also make extra backup default.xml and traccar.xml files with timestamp after every upgrade

https://mega.nz/file/6ttEzLqL#MrHemJxs8JcKWagqL15PtOLfhCq1N6Eb6Z-QEOAYwLM

Smartinet3 years ago

Use this at own risk, without elevated privileges, this will delete your config file and wipe all settings as it did to me. No error checking or warnings.

Ensure you run this as:
sudo sh traccar_tools.sh

Pat2 years ago

Just wanted to say thankyou Slawek, this has saved me so much time and fiddling around.

I do need to add as this is important for anyone using the script, that on the first try (upgrade) it had an issue downloading the new traccar file (404 error) and left me with a deleted install (of course as any sensible person did I did a full backup prior, simply restored back to working state).
I simply had to change the script to point to the latest install file directly (line 109 in the case of upgrade) and it worked perfectly second time around!

Thanks again :)

Slawek2 years ago

new version should work good with ver 5.0 - 5.9

https://mega.nz/file/P09wCT6D#ZnJ7Z1-zZgeU4b02jyw6TQ_2jwNomxhLdoAQOoF8aCU

Pat2 years ago

I can confirm that this is the case.
Thanks for the extraordinarily quick response :)

geofreygachie2 years ago

Thank you, Anton and the entire team for the good work on version 5.2
Slawek thank you for the script.

Pat10 months ago

Hi Slawek,

Just wondering if there are any plans to update the tool to support v5.11 onwards?

geofreygachie10 months ago

@pat i managed to tinker with the existing script to upgrade to version 5.11 . Please have a backup before using the script.

https://pastebin.com/dZa8JpNL