Posts

Showing posts from May, 2020

Symfony - clear cache

I was a bit surprised when I learnt that the only way to clear the cache on a Symfony 4 system is to run a local command on the system, as I don't want anyone to log into a production server (deployment is automated). And when you run the command, you must run it as the user that your web server is running under.  For distros of the Red Hat family, this user is apache by default.  For the Debian family, it is www-data. Here is how I did it.  Let's say that the user that is used for automated deployment is 'user123', here's what I did: Create a file in the /etc/sudoers.d directory (example: /etc/sudoers.d/user123_bin_console) Put this line in the file: user123 ALL=(apache) NOPASSWD: /path/to/bin/console Once this file is in place, you can log into the system and execute the sudo -l command to show what commands this user is allowed to execute via sudo and make sure the command you specified in the newly created file is present To clear the cache, execute this command

Networker automated recovery testing using the REST API - first script

I have worked a lot on my automated recovery script recently and finally got to a version that is a really good proof of concept and that I'm not scared to publish.  Plus, I have created a Gitub repo for documentation, issue management and, of course, Git features. The script is not perfect but it is even better than what I was planning when I wrote my first post on the topic: A lot of checks have been put in place to make sure all variables are provided, and in the right format There is an inline help with -h The script chooses a backup randomly amongst all the available backups, not only the 30 last ones It only requires bash, cURL and jq, on a machine that has access to the Networker REST API Only tested on RHEL 6 for now The script is not complete (I already created more than 10 issues to add features, improve current features or fix things), but it is a very good start for an organisation that wants to make recovery tests easier. The Github repo will also allow