I would like to set a REDIS_ROOT in my redis.conf file and be able to reuse that same variable across a number of other configuration points. I want to have all my logs, dumps, etc. go somewhere in this directory... something like $REDIS_ROOT/logs/redis.log.
Is there a way to set a variable of this kind in the Redis configuration file? Or am I stuck retyping it over and over (or doing some find-replace wizardry before using the conf file).
There does not appear to be any way to do this with Redis config files. However, there are only a couple places you should need to use a directory, unless you are doing a lot of includes. Redis configuration just isn't very complicated.
Related
I have been using a config macro in each model of my project, and many of them have the same exact config.
I know you can set general settings on a folder in dbt_project.yml, but we have many developers and many directories and having the configuration there gets messy very fast.
I'm wondering if there’s an alternate way to set such a config on a directory level? Like with a config.yml in the directory itself?
Conditionally Redis automatically changes its configuration file via CONFIG REWRITE execution. I sometimes want to preserve the original version of the file.
Is there a way I should follow?
I remember playing around with some settings and I believe it changed the location of dump.rdb. Now, dump.rdb auto-magically appears at the root of my projects.
Where does it belong, and how would I return it there? Also, how does this location change when in a production environment?
Where does it belong?
Wherever you want.
The default directory is ./, meaning the directory where the Redis server got started from.
Edit:
* I am modifying your second question (asked in comment) a little bit.
Is it possible to change to location of dump.rdb? How?
Yes, it is possible. There two possible ways I can think of.
1.
Modify redis configuration file (e.g. redis.conf) and restart redis server. This way, every restart after this one will use the new directory. But redis will not reload any previous data at first restart (because there will not be anything to reload from).
To reload previous data, previous dump.rdb would have to be moved to new location manually before restarting the server.
2.
Set new directory by CONFIG SET command. E.g.
CONFIG SET dir path/to/new/directory
* Note that the path has to be a directory.
That's it! But this way is not permanent because server restart will use the old directory.
To make new directory permanent, execute CONFIG REWRITE to rewrite the configuration file. Remember, redis server has to have write permission to that file.
dir path/to/dorectory has to be set in the redis config file.
I'm using Rsnapshot to backup all my servers on an EncFS encrypted partition. The partition has been created with the default paranoia mode offered by EncFS, thus it doesn't support hard links.
I'm able to run Rsnapshot the first time (creating daily.0, weekly.0, monthly.0) but not the second time.
Is there a way to use Rsnapshot without the hardlinking feature? I know it sounds a bit silly, but my rsnapshot.conf is very well configured and I don't want either to switch to another software or erase and recreate the EncFS volume.
Thank you
Look for this section in /etc/rsnapshot.conf file:
# If your version of rsync supports --link-dest, consider enable this.
# This is the best way to support special files (FIFOs, etc) cross-platform.
# The default is 0 (off).
#
#link_dest 0
Make sure the "link_dest" is disabled. This is used as a flag when rsync command is called in the background. As per the man page for rsync:
--link-dest=DIR hardlink to files in DIR when unchanged
Can we make use of php.ini variables in other configuration files like log4php configuration file?
In log4php I am using LoggerAppenderRollingFile appender and I have used log file location as /var/www/MyProject/logs/log.text, But I want to externalize the project root ( /var/www/MyProject ) instead of hardcoding and I thought of having it in php.ini.
Is it possible to do it using php.ini, or can you suggest me a way to do it?
I'm not sure it's a great idea to put application specific configurations in php.ini, but regardless if you use php.ini or another ini file you can use parse_ini_file or parse_ini_string for loading data from it.