Page 1 of 1

Install script

Posted: Sun Oct 18, 2020 11:51 am
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

Re: Install script

Posted: Sun Oct 18, 2020 5:41 pm
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?

Re: Install script

Posted: Mon Oct 19, 2020 5:00 am
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.

Re: Install script

Posted: Sun Nov 15, 2020 11:34 pm
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.