How to run this redis-cli bash command in node.js?
53 views
Skip to first unread message
Peppy
unread,
Apr 8, 2018, 1:31:57 AM4/8/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Redis DB
Greetings,
I am trying to run this command in node.js:
redis-cli --scan --pattern 'sockets:*'| xargs redis-cli del
This command needs to run when my node.js server crashes and then restarts. I am also using pm2 and clustering with just 1 instance, so the server restarts automatically. I need to have these prefixed keys completely removed before they can be repopulated.
The command above works on the command line. How do I get it to run in node upon restart?
Thanks
Kind regards
Tuco
unread,
Apr 9, 2018, 1:23:19 AM4/9/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Redis DB
Shouldn't this be part of some node.js forum?
Maybe you should just try to search how to execute a shell script from node.js