Save DB dump after warm/fast reboot (#8803)

As a part of warmboot, redis database is dumped:
c97fe546e5/scripts/fast-reboot (L269)
However, this dump file is deleted, after it is loaded back into db post reboot.
The DB dump can be useful for debugging purpose, hence taking a backup of it can be useful.
Instead of deleting the dump, rename and keep the dump.
This commit is contained in:
Vaibhav Hemant Dixit 2021-09-23 23:53:22 -07:00 committed by Judy Joseph
parent 17ccd8babe
commit 65c9092266

View File

@ -143,7 +143,8 @@ function postStartAction()
sleep 1;
done
if [[ ("$BOOT_TYPE" == "warm" || "$BOOT_TYPE" == "fastfast") && -f $WARM_DIR/dump.rdb ]]; then
rm -f $WARM_DIR/dump.rdb
# retain the dump file from last boot for debugging purposes
mv $WARM_DIR/dump.rdb $WARM_DIR/dump.rdb.old
else
# If there is a config_db.json dump file, load it.
if [ -r /etc/sonic/config_db$DEV.json ]; then