Install script

Forum rules
Before you post please read how to get help
Post Reply
Wazzking
Level 1
Level 1
Posts: 2
Joined: Sun Oct 18, 2020 11:45 am

Install script

Post by Wazzking »

Looking at writing a bash script to update an application folder and process.

Couple of things.

I was thinking of update via symlink ie adding new binaries and pointing symlink to new folder instead of replacing existing? Good practice?
Anyone have an example of such a script to fetch stop download repoint and start - log ? Anything i've missed in those steps appreciated

TIA
User avatar
Kadaitcha Man
Level 11
Level 11
Posts: 3596
Joined: Mon Aug 27, 2012 10:17 pm

Re: Install script

Post by Kadaitcha Man »

Wazzking wrote:
Sun Oct 18, 2020 11:51 am
I was thinking of update via symlink ie adding new binaries and pointing symlink to new folder instead of replacing existing? Good practice?
Anyone have an example of such a script to fetch stop download repoint and start - log ? Anything i've missed in those steps appreciated
What on earth are you talking about?
Coming to a thread near you: Lots of bragging about my AMD 5950X. Currently delayed due to high demand.
It's pronounced kad-eye-cha, not kada-itcha.
Wazzking
Level 1
Level 1
Posts: 2
Joined: Sun Oct 18, 2020 11:45 am

Re: Install script

Post by Wazzking »

Kadaitcha Man wrote:
Sun Oct 18, 2020 5:41 pm

What on earth are you talking about?

Don't tell me you're wearing jeans t-shirt maybe check shirt with hair too long for your age. Loves heavy metal and abstract bands Star Wars and any other trilogy. Do you only converse in C#? :D

Anyway lets start again hello Kadaitcha Man

Im looking at a self-updating script. MY first steps are to define what i want it to do.


Check for new version if none exit
stop service/daemon
Backup old versionof working directory
wget new binaries to parallel directory location give naming format
copy into existing folder for service/daemon to keep paths same.
start service/daemon

My mention of simlink is i've seen some places for example java is simlinked to latest version binaries so as new ver is added simlinked java just points to the newer directory and of course easy to rollback to older. Is that good practice or a better way?

Your thoughts or anyone elses welcome. Many thanks.
User avatar
Termy
Level 5
Level 5
Posts: 878
Joined: Mon Sep 04, 2017 8:49 pm
Location: UK
Contact:

Re: Install script

Post by Termy »

If you can be explicit in what you're wanting, I could literally write something for you, or better guide you in the right direction.

Starting a service is done with systemctl(1). Backing up can be done with something like tar(1) with gzip(1) compression. Downloading can be done with wget(1) or curl(1), but you seem aware of that already. Check out the man(1) pages (hence the parentheses).

From you recent post here on this thread, it seems like you have a service or daemon which needs to be stopped, have some maintenance stuff done to it, then started back up again.
I use Linux Mint 18.3 with Cinnamon in a VirtualBox VM for testing & sandboxing.

I'm LearnLinux (LL) on YouTube: https://www.youtube.com/channel/UCfp-lN ... naEE6NtDSg
I'm also terminalforlife (TFL) on GitHub: https://github.com/terminalforlife
Post Reply

Return to “Scripts & Bash”