How To Increase size of /var/tmp and /tmp ?

Divvy

Member
Jul 10, 2005
12
0
151
Hi cPanel team,

Can someone help me?
How can I increase the space of /var/tmp and /tmp ?
I have only 512MB and is not enough because the tmp partition goes full when the scheduled backup runs.

I tried this tutorials:
http://forums.cpanel.net/f5/drive-critical-dev-loop0-var-tmp-97-full-190772.html
/http://blog.shineservers.com/how-to-increase-size-of-vartmp-and-tmp-centos/

But without luck...

My securetmp content after running the command:
vi /usr/local/cpanel/scripts/securetmp
Code:
#!/usr/local/cpanel/3rdparty/bin/perl
# cpanel - scripts/securetmp Copyright(c) 2012 cPanel, Inc.
# All rights Reserved.
# [email protected] http://cpanel.net
# This code is subject to the cPanel license. Unauthorized copying is prohibited

use strict;
use Cpanel::SafeFile ();
use Cpanel::OSSys ();
use Cpanel::Filesys ();
use Cpanel::DiskLib ();
use Getopt::Long;
use Cpanel::Logger ();
use Cpanel::SafeRun::Errors ();
use Cpanel::SafeRun::Simple ();

my $logger = Cpanel::Logger->new();

$| = 1;

if ( -e '/var/cpanel/version/securetmp_disabled' ) {
print "[securetmp] Disabled per /var/cpanel/version/securetmp_disabled\n";
exit;
"/usr/local/cpanel/scripts/securetmp" 681L, 21312C

Can someone give me a little help?

Thanks :)

Best regards,
Tim
 
Last edited:

Infopro

Well-Known Member
May 20, 2003
17,113
507
613
Pennsylvania
cPanel Access Level
Root Administrator
Twitter
It seems to me that you've made a mess of that file. Did you back it up before modifying it? As mentioned by cPanelTristan, you're only modifying one line in the file. This one:
my $tmpdsksize = 512000; # Must be larger than 250000
And then you save file.

Once you've edited that one line, and saved the file, you run the rest of the steps.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,201
363
Hello :)

The securetmp script will utilize 1% of disksize with a minimum of 500M and a maximum of 4G, based on the available space on the /usr partition (where the tmpDSK file is stored). You are welcome to manually create a /tmp partition if you prefer to use a larger size.

Thank you.
 

Divvy

Member
Jul 10, 2005
12
0
151
Hi guys,

Thank you for your reply and for trying to help me.

The problem is that I cant find the line to edit:
$tmpdsksize = 512000;

Using the command:
# nano /usr/local/cpanel/scripts/securetmp
Or
# pico /scripts/securetmp

Where could this line be hidden!? Any ideas?

Thanks!

Best regards,
Tim
 

cgimickalo

Well-Known Member
Apr 19, 2013
78
0
6
N.W. Iowa
cPanel Access Level
Root Administrator
We did this a while back to decrease the /var/tmp size. All I did was download the securetmp script, besure to download it as ASCII Text format, then look for the setting $tmpdsksize = 512000 should be around line 148 or 150. Edit the file as a text file, save it in a UNIX or Text format, then upload it back to folder it's keep in the ASCII Text format & besure it's executable. Then simple execute the script and answer the 2 questions w 'y' if I remember correctly. That should do it.

Mike
 

Divvy

Member
Jul 10, 2005
12
0
151
Thank you guys!

The problem was me... I forgot to scroll down the file lol :)
Btw, I changed to 10GB but only appears 4GB. Is 4GB the maximum size that $tmpdsksize can handle?

I need a bigger value because tmp partition goes full when the scheduled backup runs. I think that is because Im using the remote ftp. Is there any alternative solution for me?

Thanks!
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,201
363
Btw, I changed to 10GB but only appears 4GB. Is 4GB the maximum size that $tmpdsksize can handle? I need a bigger value because tmp partition goes full when the scheduled backup runs. I think that is because Im using the remote ftp. Is there any alternative solution for me?
Yes, please see my previous post:

The securetmp script will utilize 1% of disksize with a minimum of 500M and a maximum of 4G, based on the available space on the /usr partition (where the tmpDSK file is stored). You are welcome to manually create a /tmp partition if you prefer to use a larger size.
Thank you.
 

zestylemon

Member
Jul 19, 2010
10
0
51
The securetmp script will utilize 1% of disksize with a minimum of 500M and a maximum of 4G, based on the available space on the /usr partition (where the tmpDSK file is stored). You are welcome to manually create a /tmp partition if you prefer to use a larger size.
Hi Michael,

It would be appreciate if you would please post instructions on how to do this as I've searched but not yet found any thing.

Thanks :)
 
Last edited by a moderator:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,201
363
Manually modifying the size of the tmp partition is an OS procedure if you are not using the /scripts/securetmp application. You can find instructions by searching for a term such as "Resize tmp OS" on a search engine. Replace "OS" with the actual name of the OS you are using.

Thank you.