Page 1 of 1
Cron : Delet Backup + Free Cached Memory
Posted: Mon Feb 13, 2017 12:51 pm
by SimpleSample
Hello guys,
I would like to know if there is a way to creat 2 cron job :
The first is for delet backup old than 24hours & the third is too creat a cron job that will free the cached memory.
I've found 2 old thread talking about it but I don't know if they are still working with the last version of vestacp and debian.
Thanks
Re: Cron : Delet Backup + Free Cached Memory
Posted: Tue Feb 14, 2017 3:32 am
by noogen
Have you try adding the cron job from the UI? You can add cronjob that run as with priviledges under the admin account by adding sudo in front of it. Just buy the file manager and you can edit your bash script from the UI too.
Add new file under /home/admin/bin/yourscript.sh and change permission to make it executable.
Setup the job in the UI to: /home/admin/bin/yourscript.sh
or: sudo /home/admin/bin/yourscript.sh
1) What do you mean clear cache? There is already a cron job that install with your php that clear your session.
2) As for deleting file olders than x days, why? VESTA already handle this for you and it does it very well. By default, it keep the last 3 backups per user - see: /usr/local/vesta/data/users/username/user.conf - variable BACKUPS if you want to change this value.
Re: Cron : Delet Backup + Free Cached Memory
Posted: Tue Feb 14, 2017 1:05 pm
by SimpleSample
Hi
1) What do you mean clear cache? There is already a cron job that install with your php that clear your session.
I'm talking about the cached memory , when I use glances , I have a lot of memory cached
I've just restarded my vps and I already have almost 2gb in the cached memory
2) As for deleting file olders than x days, why? VESTA already handle this for you and it does it very well. By default, it keep the last 3 backups per user - see: /usr/local/vesta/data/users/username/user.conf - variable BACKUPS if you want to change this value.
Ok thanks I'm gonna delet the cron instead , because backup are taking to many space on my vps, also can I manualy delet all the files inside the backup folder ?

Re: Cron : Delet Backup + Free Cached Memory
Posted: Tue Feb 14, 2017 7:02 pm
by pmesco
SimpleSample wrote:Hi
1) What do you mean clear cache? There is already a cron job that install with your php that clear your session.
I'm talking about the cached memory , when I use glances , I have a lot of memory cached
I've just restarded my vps and I already have almost 2gb in the cached memory
Try adding this to your cronjobs
Code: Select all
sync; echo 3 > /proc/sys/vm/drop_caches
Re: Cron : Delet Backup + Free Cached Memory
Posted: Tue Feb 14, 2017 7:21 pm
by noogen
SimpleSample wrote:
Ok thanks I'm gonna delet the cron instead , because backup are taking to many space on my vps, also can I manualy delet all the files inside the backup folder ?

You can safely delete those. It appear that you do not have any backups? Otherwise, you would have files like username.tar.gz. Check to see what's causing your backup to fail. Those tmp folders should not be there longer than a couple of hours unless your backup is failing.
Also, there is a couple of known issue with backup failing due to some bugs ref:
https://github.com/serghey-rodin/vesta/issues/1035
viewtopic.php?f=41&t=13286
and if you're running postgresql 9.5 then here:
https://github.com/serghey-rodin/vesta/issues/913
Re: Cron : Delet Backup + Free Cached Memory
Posted: Tue Feb 14, 2017 7:38 pm
by SimpleSample
You can safely delete those. It appear that you do not have any backups? Otherwise, you would have files like username.tar.gz. Check to see what's causing your backup to fail. Those tmp folders should not be there longer than a couple of hours unless your backup is failing.
Also, there is a couple of known issue with backup failing due to some bugs ref:
https://github.com/serghey-rodin/vesta/issues/1035
viewtopic.php?f=41&t=13286
and if you're running postgresql 9.5 then here:
https://github.com/serghey-rodin/vesta/issues/913
Thanks , I've deleted those folders , the backup is disable so it's should be ok now.
I'm gonna check the github & the topic
Try adding this to your cronjobs
Code: Select all
sync; echo 3 > /proc/sys/vm/drop_caches
I've created a cron job but I think that not working
I've try to run the command with putty instead of the cron job , and I have a persmission denied even with a sudo & log as root
Re: Cron : Delet Backup + Free Cached Memory
Posted: Tue Feb 14, 2017 8:41 pm
by noogen
I would suggest against it - see here:
http://serverfault.com/questions/597115 ... s-in-linux
I've been working with linux for a long time and never really have to use this drop caches method.
If you're running into a problem:
1) Figure out what is causing the problem. #1 rule of thumb is to look at system logs and stats.
2) If all else failed is because you're hitting your limit so just get/buy more memory.
Re: Cron : Delet Backup + Free Cached Memory
Posted: Mon Feb 20, 2017 11:50 am
by SimpleSample
noogen wrote:I would suggest against it - see here:
http://serverfault.com/questions/597115 ... s-in-linux
I've been working with linux for a long time and never really have to use this drop caches method.
If you're running into a problem:
1) Figure out what is causing the problem. #1 rule of thumb is to look at system logs and stats.
2) If all else failed is because you're hitting your limit so just get/buy more memory.
Hello
It's seems like my problem is solved I don't really know why, but my ram issue is gone
Thanks for your time guys