Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section Web Server
  • Search

Cron : Delet Backup + Free Cached Memory

Questions regarding the Web Server
Apache + Nginx, Nginx + PHP5-FPM
Post Reply
  • Print view
Advanced search
8 posts • Page 1 of 1
SimpleSample
Posts: 19
Joined: Thu Dec 01, 2016 8:53 am

Cron : Delet Backup + Free Cached Memory
  • Quote

Post by SimpleSample » Mon Feb 13, 2017 12:51 pm

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
Top

noogen
Posts: 66
Joined: Thu Jan 05, 2017 9:20 pm

Re: Cron : Delet Backup + Free Cached Memory
  • Quote

Post by noogen » Tue Feb 14, 2017 3:32 am

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.
Top

SimpleSample
Posts: 19
Joined: Thu Dec 01, 2016 8:53 am

Re: Cron : Delet Backup + Free Cached Memory
  • Quote

Post by SimpleSample » Tue Feb 14, 2017 1:05 pm

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

Image

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 ?

Image
Top

pmesco
Posts: 15
Joined: Fri May 22, 2015 11:30 am

Re: Cron : Delet Backup + Free Cached Memory
  • Quote

Post by pmesco » Tue Feb 14, 2017 7:02 pm

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

Image
Try adding this to your cronjobs

Code: Select all

sync; echo 3 > /proc/sys/vm/drop_caches
Top

noogen
Posts: 66
Joined: Thu Jan 05, 2017 9:20 pm

Re: Cron : Delet Backup + Free Cached Memory
  • Quote

Post by noogen » Tue Feb 14, 2017 7:21 pm

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 ?

Image
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
Top

SimpleSample
Posts: 19
Joined: Thu Dec 01, 2016 8:53 am

Re: Cron : Delet Backup + Free Cached Memory
  • Quote

Post by SimpleSample » Tue Feb 14, 2017 7:38 pm

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

Image

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
Top

noogen
Posts: 66
Joined: Thu Jan 05, 2017 9:20 pm

Re: Cron : Delet Backup + Free Cached Memory
  • Quote

Post by noogen » Tue Feb 14, 2017 8:41 pm

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.
Top

SimpleSample
Posts: 19
Joined: Thu Dec 01, 2016 8:53 am

Re: Cron : Delet Backup + Free Cached Memory
  • Quote

Post by SimpleSample » Mon Feb 20, 2017 11:50 am

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
Top


Post Reply
  • Print view

8 posts • Page 1 of 1

Return to “Web Server”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password