[squid-users] Backing up squid cache and restoring it

Arne-Tobias Rak arne-tobias.rak at stud.tu-darmstadt.de
Thu Jan 24 09:50:07 UTC 2019


Thank you for your help. I eventually managed to get it working. The 
problem was related to stopping the squid service using the -k argument.

Closing squid using

sudo service squid stop

allows me to restore previous cache contents without any issues.


Am 17.01.2019 um 18:22 schrieb Alex Rousskov:
> On 1/17/19 6:47 AM, Arne-Tobias Rak wrote:
>
>> my goal is to restore a previous cache state in squid 3.x running on
>> Ubuntu 16.04.
>>
>> So far I have tried to create a copy of the /var/spool/squid and
>> /var/log/squid folders.
>> When restoring the cache, I first shutdown squid using
>> /sudo squid -k shutdown//
>> //sudo service squid stop -k
>> /and then restore the previously copied folder contents. I then start
>> squid again using
>> /sudo service squid start./
>> Unfortunately, this does not restore the previous cache contents, as the
>> spool/squid/swap.state file is modified during squid startup.
> Modification of swap.state upon startup is not incompatible with cache
> contents preservation.
>
> In a clean shutdown context, the swap.state* files are essentially an
> optimization. You may preserve/restore them if you want to speed up
> building of the restored cache index OR you can delete them (and Squid
> will slowly build a new cache index from scratch). Just do not leave the
> newer swap.state* files when trying to restore the old cache.
>
> If you preserve/restore the old swap.state* files, you may need to
> preserve their timestamps as well.
>
>
> If you need further help, please share cache.log entries related to
> cache_dir loading and indicate why you think the old cache contents is
> not preserved. Sharing your cache_dir configuration may also help.
>
>
> Cheers,
>
> Alex.
> _______________________________________________
> squid-users mailing list
> squid-users at lists.squid-cache.org
> http://lists.squid-cache.org/listinfo/squid-users


More information about the squid-users mailing list