Since Squid stores all data in the configuration files so we will just need to backup the all configuration files.
For the backup following directories must be manually
backed up.
./squid-data/cache-dir
./configs/squid.conf
./configs/squid.conf.d
Run following command to trigger the backup.
This will copy all the configuration files in the ./squid-data/backups
directory.
cp -a ./squid-data/cache-dir ./configs/squid.conf ./configs/squid.conf.d ./squid-data/backups/
Followings conditions must be met for restore.
- A working Squid instance.
- Stop the Squid container.
docker-compose down squid
- Restore/Copy the configuration files.
First remove existing directories.
./squid-data/cache-dir
./configs/squid.conf
./configs/squid.conf.d
Now copy backed up directories.
Copy cache-dir to ./squid-data/cache-dir
Copy squid.conf to ./configs/squid.conf
Copy squid.conf.d to ./configs/squid.conf.d
docker-compose down
docker-compose up -d
docker-compose logs -f