I need to debug a session problem, so I have to search for a certain string in the whole redis database. Is this possible?
I was able to debug it by using redis-cli monitor | tee monitor_log.txt and then searching in the file.
Related
I'm using redis to store the userId as a key and the socketId as the value. What's more important is that the userId doesn't change, but the socketId constantly changes. So I want to edit the socketId value inside redis, but I'm not sure what node_redis command to use. I'm currently just editing by using .set(userId, mostRecentSocketId).
In addition, I haven't found a good node_redis API anywhere with a complete list of commands. I briefly looked at the redis-commands package, but it still doesn't seem to have a full list of complete commands.
Any help is appreciated; thanks in advance :)
The full list of Redis commands can be found at https://redis.io/commands. After finding a proper command it wouldn't be hard to find how is it proxied in binding ("api") you use.
Upd. To make it clear: you have Redis Server, its commands are listed at the doc I provided. Then you have redis-commands - it's a library for working with redis (I called it a "binding"). My point was that redis-commands may have not all the commands that redis-server can handle, and also the names of some commands can differ a bit. Some other bindings can offer slightly different set of commands. So it's better to examine the list of commands that Redis Server handles, and then select a binding that allowes calling that command (I guess all the bindings have set method)
I am learning Redis right now and one of the first things I did was trying to interactively issue commands to an online Redis server: http://try.redis.io/
The FLUSHALL command is well documented here: http://redis.io/commands/flushall and is also referenced in this SO answer.
But when I try to issue it, it is simply not recognized:
My question: Why? Where has it disappeared? After all, the documentation says it is:
"Available since 1.0.0."
The web interface at try.redis.io, while executing against a real Redis database, offers only a subset of the actual commands. Because the database is shared by all users of the interface, some commands (FLUSHALL for example) are disabled in it.
I have several jobs running periodically on Jenkins. They are set up using the graphical interface:
Now I need to write a script that will pull information about when/how often does job run. How can I find this information?
I tried looking for this information using Remote Access API in XML, but to no avail.
Edit: Because some people find it hard to read such a short post, I would like to point out that I'm asking(literally) How to check how often is Jenkins building job? for script. Question means more or less how to get cron schedule for the job, not how to get Build number + Status[success/failed etc] + Duration from Jenkins.
Honestly, I can't see how one could even think that these are duplicates.
Here you go:
SCHEDULE=$(cat ${JENKINS_HOME}/jobs/${JOB_NAME}/config.xml | grep -A 1 ' <hudson.triggers.TimerTrigger>' | tail -1 | awk -F'[<>]' '{print $3}')
if [ -z "${SCHEDULE}" ]; then
echo "${JOB_NAME} isn't configured to run periodically"
fi
You need access to filesystem on which Jenkins has it's home.
If this approach does not suit you - you can use token authentication or password/LDAP/whatever to download the job config xml to your working directory and parse it the same way. This might be helpful if you decide to do so.
Given a snapshot of an existing redis database in a dump.rdb (or in .json format) file, I want to restore this data in my own machine to run some tests on it.
Any pointers on how to do this would be greatly appreciated.
I have resorted to trying to parse the data in the dump.rdb and then save it in a redis DB manually. I feel like there is/should be a cleaner way.
If you want to restore the entire file, simply copy it to the right directory specified in redis.conf and restart redis server. But if you want to load a subset of keys/databases, you'd have to parse the dump file.
SO:
I continued doing it the "hacky" way and found that using the parser code found here:
https://github.com/sripathikrishnan/redis-rdb-tools was a great help.
using the parser sample code i could:
1) set up a redis client
2) use the parser to parse the data
3) use the client to "set" parsed data into a new redis database.
the rdd tools can also do that,
it work independantly of .rdb files and dump/restore working redis instances
it can apply merge, split, rename, search, filter, insert, delete on dumps and/or redis
I´m writing a Powershell script to do a bunch of things and when finished it will be run as a scheduled task. For that reason I want to be able to check whether an older instance is still alive when I start running the script and kill the older one if it exists.
I was thinking I would use something like this:
$process = Get_Process | $name
$process.kill
But how to get the $name variable in a simple way?
Does anyone have a better suggestion?
Best regards,
Gísli
You can do this in windows scheduled task configuration. The settings depends on the OS you are using though.
EDIT: that is you can configure the task to be killed after a certain period of time (i.e. when your next one starts).
Why do you need to get the name? Get-Process returns high fidelity Process objects and you can operate on it directly.
To get a process of a particular name use $n = Get-Process notepad, say, and then do $n.kill() to kill it. If you do need to check the name again, do $n.Name. To see what properties and methods you can use, try $n | get-member
And make sure you read the manual: http://technet.microsoft.com/en-us/library/dd347630.aspx