Passbolt shortcuts with .bashrc

:smile: The user @JamesBond and user @_jc on the Passbolt discourse user forum showed some cool shortcuts. Change the code to match the LinuxBabe instructions.

From @JamesBond

I really got tired of typing out the following to do a health check;

su - www-data -s /bin/bash -c "/usr/share/php/passbolt/bin/cake passbolt healthcheck"
So I created an alias to make life a little bit easier.
To create an alias simply open up the .bashrc file located in your home directory. You could use the following and open it no matter what directory you are in.

nano ~/.bashrc
Once opened, go right to the bottom of the page and add the following.

alias healthCheck='su - www-data -s /bin/bash -c "/usr/share/php/passbolt/bin/cake passbolt healthcheck"'
Once that is done, source the newly updated .bashrc

source ~/.bashrc
Now you will be able to simply type healthCheck and run the health check without having to type out everything :slight_smile: .

Enjoy the cheat alias,

From @_jc

I am also bored to type this command as well This post is a good idea.

On my side, I created a passbolt bash function in my ~/.bashrc:

passbolt () { 
  sudo su - www-data -s /bin/bash -c "/usr/share/php/passbolt/bin/cake $(echo [email protected])"; 
It is a shorcut to the ./bin/cake shell script.

You can use it like this:

# Healthcheck
$ passbolt passbolt healthcheck
# Datacheck
$ passbolt passbolt datacheck --hide-success-details
# Clear cache
$ passbolt cache clear_all
# Database migration status
$ passbolt migration status

click here for the full posts