0

On our unix webhost, I created a set of scripts for automating the website deploy process. Since I was the only user, I had the scripts keeping track of what phase of the deploy it was in by changing values in a dot-file in my home directory: ~/.deploy.

Now we've brought another developer on board, so I moved our scripts to /usr/local/bin so that the other dev (and anyone else) would have access to run them.

However, I want there to be one global state of the deploy process-- so I don't want the .deploy file to live in the home directory of the user running the scripts.

What would be the global place for such a file to live? So that, in the case that one developer starts the deploy but doesn't complete it, the next user running the scripts reads the current state of the deploy, as tracked in .deploy.

Is /tmp the proper place? Is a file written there accessible by all users? Will it stay there until actively deleted?

1
  • You don't have to use /usr/local/bin you can keep it is your directory, if you give permissions. However it will be less easy to find. Jul 26, 2019 at 15:36

1 Answer 1

1

You can keep the file with the script /usr/local/var. However be very careful with concurrency. (I would not do it this way)

To keep file accessible, I would create a new group for the tool.

addgroup deployer
mkdir /usr/local/var/deployer
chgrp deployer /usr/local/var/deployer /usr/local/bin/deploy
chmod g+x /usr/local/bin/deploy

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .