Backing up redis rdb file is simply copy .rdb to your backup location. So, we have to choose any safe destination that we'd like to store the snapshot file (It is usually safer to transfer to a different server or disk). But, let's figure out where the current RDB file is located
cat /etc/redis/redis.conf |grep '^dir '|cut -d' ' -f2
On my box, /var/lib/redis is the directory where the snapshot file is dumped to. Before copying, it is good idea to save the db in background.
redis-cli bgsave Then copy it to somewhere that is safe. (The path /backup/redis is just an illustration of where it could be copied to)
cp /var/lib/redis/dump.rdb /backup/redis/dump.$(date +%Y%m%d%H%M).rdb