Exclude LiteSpeed /lscache direcory from backup

serpent_driver

Well-Known Member
Aug 1, 2019
57
10
8
Home
cPanel Access Level
Root Administrator
Hello Everybody,

I have LiteSpeed webserver and use LScache. LScache stores cached files in /lscache directory. As you possibly know the amount of cached files changes very often and in my case I don't have only 1 cache directory to store cached files. Each cache directory has up to 5 GB of stored cache files. If I do a backup with cPanel a backup not only takes much time for backup, the backup archive is mostly destroyed, because of the high frequency of changed cached files.

I know there is already an exception for /lscache directory if an account will be transfered with WHM transfer tool, so why don't you also except /lscache directory from backup? Of course my case with this high numer of cached files isn't a standard case, but backing up a directory that contains files with a high frequency of changes doesn't make sense for backup. It is the same situation if an account will be transfered.

To edit /etc/cpbackup-exclude.conf is no good idea....
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
6,810
895
313
cPanel Access Level
Root Administrator
Hey there! Is your LScache being stored in /home/lscache? If so, I wouldn't expect that directory to be backed up by default as it would not be owned or handled by any individual cPanel user.

If you're seeing a cache directory in another location could you let me know where that is?
 

serpent_driver

Well-Known Member
Aug 1, 2019
57
10
8
Home
cPanel Access Level
Root Administrator
Is your LScache being stored in /home/lscache?
Yes, for Server level, but it is unused. On VHost Level every account has its own /lscache dir in /home/account/lscache and this location is affected from backup. In my case I have additional /lscache dir for each subdomain. /home/account/subdomain.lscache
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
6,810
895
313
cPanel Access Level
Root Administrator
Thanks for the additional details. Would you happen to be using the WordPress plugin as well to generate that cache? I would still recommend using the exclude file at /etc/cpbackup-exclude.conf, but you mentioned you didn't like this idea - is there a reason for that?
 

serpent_driver

Well-Known Member
Aug 1, 2019
57
10
8
Home
cPanel Access Level
Root Administrator
Would you happen to be using the WordPress plugin as well to generate that cache?
No, I developed a couple of new plugins for applications where is no plugin available, but they follow cache behaviour like all plugins do. Location where cache is stored is based on server configuration and can't be modifed by a plugin.


is there a reason for that?
Yes, there is a good reason. WHM is a mighty control panel where in (almost) everything can be configured, so why to edit a configuration file? Making a backup isn't a rare job, so why don't you extend this important function to get a little bit more comfort? :) Sorry, I am spoiled..... from WHM!