Tmp directory of dns only-updates

Elizabeta

Well-Known Member
Mar 21, 2018
225
31
28
Mostar
cPanel Access Level
Root Administrator
Hello,

I have a cpanel&WHM version 84.0.19 . I should deleted some files from directory /tmp because small storage space (because commvault backup on cPanel).
Can I do it?

Code:
[[email protected] ~]# ls -la /tmp
total 236
drwxrwxrwt. 31 root root 12288 Jan 16 10:43 .
dr-xr-xr-x. 18 root root   273 Jan 16 10:43 ..
-rw-------   1 root root   970 Jan 13 08:39 10313.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.068a65dc.tmp
drwx------   2 root root  4096 Jan 13 08:39 10313.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.89007bd3.tmp
-rw-------   1 root root   970 Sep 11 08:02 10411.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.be5ea661.tmp
drwx------   2 root root  4096 Sep 11 08:02 10411.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.fed84d0a.tmp
-rw-------   1 root root   970 Aug 26 12:40 10571.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.0a9aec6c.tmp
-rw-------   1 root root  3858 Aug 26 12:40 10571.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.1246eb23.tmp
drwx------   2 root root  4096 Aug 26 12:40 10571.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.ddcc57c6.tmp
-rw-------   1 root root   970 Sep  5 13:53 11489.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.a18704ef.tmp
drwx------   2 root root  4096 Sep  5 13:53 11489.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.de06719d.tmp
-rw-------   1 root root  3858 Aug  1 12:09 12691.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.24487523.tmp
-rw-------   1 root root   970 Aug  1 12:09 12691.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.684d489d.tmp
drwx------   2 root root  4096 Aug  1 12:09 12691.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.d698d038.tmp
-rw-------   1 root root   970 Aug 28 09:11 12722.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.20310bb0.tmp
drwx------   2 root root  4096 Aug 28 09:11 12722.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.aebe1593.tmp
drwx------   2 root root  4096 Jul  9  2019 14928.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.5ad10fb1.tmp
-rw-------   1 root root   970 Jul  9  2019 14928.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.a5ffec28.tmp
-rw-------   1 root root  3858 Jul  9  2019 14928.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.e55ff0e7.tmp
-rw-------   1 root root   970 Nov 26 15:30 1997.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.359e5ad2.tmp
drwx------   2 root root  4096 Nov 26 15:30 1997.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.92ab8c5d.tmp
drwx------   2 root root  4096 Sep 17 19:29 23832.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.3df685ba.tmp
-rw-------   1 root root   970 Sep 17 19:29 23832.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.ab068b9b.tmp
-rw-------   1 root root  3858 Jul 16  2019 2516.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.386afda6.tmp
drwx------   2 root root  4096 Jul 16  2019 2516.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.e888a4de.tmp
-rw-------   1 root root   970 Jul 16  2019 2516.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.f016402e.tmp
-rw-------   1 root root   970 Dec 12 10:02 25989.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.9be7f8a7.tmp
drwx------   2 root root  4096 Dec 12 10:02 25989.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.d926ec9c.tmp
drwx------   2 root root  4096 Oct 28 12:04 31515.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.9ab4ff24.tmp
-rw-------   1 root root   970 Oct 28 12:04 31515.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.dd37128f.tmp
-rw-------   1 root root   970 Sep 30 14:21 31541.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.8990cb2e.tmp
drwx------   2 root root  4096 Sep 30 14:21 31541.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.b32f1506.tmp
drwxr-xr-x.  2 abrt abrt  4096 Aug 16  2018 abrt
drwxrwxrwt.  2 root root  4096 Dec 11 08:02 .font-unix
drwxr-xr-x.  2 root root  4096 Oct 17 00:30 hsperfdata_root
drwxrwxrwt.  2 root root  4096 Dec 11 08:02 .ICE-unix
drwxrwxr-x.  2 root root  4096 Jun 11  2018 locks
drwx------   2 root root 16384 Mar 22  2018 lost+found
-rw-r--r--   1 root root    73 Sep  4 00:30 lua_6kWVhi
-rw-r--r--   1 root root    73 Oct 17 00:30 lua_b1oMqr
-rw-r--r--.  1 root root    73 Nov  1  2018 lua_gZLI4Q
-rw-r--r--   1 root root    73 Apr 18  2019 lua_LDKmqd
-rw-r--r--   1 root root    73 Jul 23 00:30 lua_lLceRZ
-rw-r--r--.  1 root root    73 Mar 14  2019 lua_nLd9wV
-rw-r--r--.  1 root root    73 Aug 16  2018 lua_Rgc9Kb
lrwxrwxrwx   1 root root    30 Jan 16 10:43 mysql.sock -> ../../var/lib/mysql/mysql.sock
drwxr-xr-x.  2 root root  4096 Jul 27  2018 process_test
drwx------   3 root root  4096 Dec 11 08:02 systemd-private-549cbe77dac144afba2ca5eb6f071c17-cups.service-8WQYTS
drwx------   3 root root  4096 Dec 11 08:02 systemd-private-549cbe77dac144afba2ca5eb6f071c17-cups.service-lUXJUH
drwx------   3 root root  4096 Dec 11 08:02 systemd-private-549cbe77dac144afba2ca5eb6f071c17-named.service-MYQRzF
drwx------   3 root root  4096 Dec 11 08:02 systemd-private-549cbe77dac144afba2ca5eb6f071c17-named.service-ZBZebW
drwx------   3 root root  4096 Nov 29 15:20 systemd-private-ec5a2f1a2cdc4d91913ed1744dfeb7e3-named.service-MwjKxK
drwx------   3 root root  4096 Nov 29 15:20 systemd-private-ec5a2f1a2cdc4d91913ed1744dfeb7e3-named.service-YgsqEz
drwxrwxrwt.  2 root root  4096 Dec 11 08:02 .Test-unix
drwxrwxrwt.  2 root root  4096 Dec 11 08:02 .X11-unix
drwxrwxrwt.  2 root root  4096 Dec 11 08:02 .XIM-unix
Thank you!

Best regards,
Elizabeta
 
Last edited by a moderator:

Elizabeta

Well-Known Member
Mar 21, 2018
225
31
28
Mostar
cPanel Access Level
Root Administrator
Hello,

I have a cpanel&WHM version 84.0.19 . I should deleted some files from directory /tmp because small storage space (because commvault backup on cPanel).
Can I do it?

[[email protected] ~]# ls -la /tmp
total 236
drwxrwxrwt. 31 root root 12288 Jan 16 10:43 .
dr-xr-xr-x. 18 root root 273 Jan 16 10:43 ..
-rw------- 1 root root 970 Jan 13 08:39 10313.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.068a65dc.tmp
drwx------ 2 root root 4096 Jan 13 08:39 10313.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.89007bd3.tmp
-rw------- 1 root root 970 Sep 11 08:02 10411.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.be5ea661.tmp
drwx------ 2 root root 4096 Sep 11 08:02 10411.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.fed84d0a.tmp
-rw------- 1 root root 970 Aug 26 12:40 10571.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.0a9aec6c.tmp
-rw------- 1 root root 3858 Aug 26 12:40 10571.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.1246eb23.tmp
drwx------ 2 root root 4096 Aug 26 12:40 10571.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.ddcc57c6.tmp
-rw------- 1 root root 970 Sep 5 13:53 11489.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.a18704ef.tmp
drwx------ 2 root root 4096 Sep 5 13:53 11489.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.de06719d.tmp
-rw------- 1 root root 3858 Aug 1 12:09 12691.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.24487523.tmp
-rw------- 1 root root 970 Aug 1 12:09 12691.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.684d489d.tmp
drwx------ 2 root root 4096 Aug 1 12:09 12691.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.d698d038.tmp
-rw------- 1 root root 970 Aug 28 09:11 12722.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.20310bb0.tmp
drwx------ 2 root root 4096 Aug 28 09:11 12722.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.aebe1593.tmp
drwx------ 2 root root 4096 Jul 9 2019 14928.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.5ad10fb1.tmp
-rw------- 1 root root 970 Jul 9 2019 14928.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.a5ffec28.tmp
-rw------- 1 root root 3858 Jul 9 2019 14928.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.e55ff0e7.tmp
-rw------- 1 root root 970 Nov 26 15:30 1997.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.359e5ad2.tmp
drwx------ 2 root root 4096 Nov 26 15:30 1997.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.92ab8c5d.tmp
drwx------ 2 root root 4096 Sep 17 19:29 23832.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.3df685ba.tmp
-rw------- 1 root root 970 Sep 17 19:29 23832.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.ab068b9b.tmp
-rw------- 1 root root 3858 Jul 16 2019 2516.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.386afda6.tmp
drwx------ 2 root root 4096 Jul 16 2019 2516.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.e888a4de.tmp
-rw------- 1 root root 970 Jul 16 2019 2516.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.f016402e.tmp
-rw------- 1 root root 970 Dec 12 10:02 25989.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.9be7f8a7.tmp
drwx------ 2 root root 4096 Dec 12 10:02 25989.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.d926ec9c.tmp
drwx------ 2 root root 4096 Oct 28 12:04 31515.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.9ab4ff24.tmp
-rw------- 1 root root 970 Oct 28 12:04 31515.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.dd37128f.tmp
-rw------- 1 root root 970 Sep 30 14:21 31541.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.8990cb2e.tmp
drwx------ 2 root root 4096 Sep 30 14:21 31541.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.b32f1506.tmp
drwxr-xr-x. 2 abrt abrt 4096 Aug 16 2018 abrt
drwxrwxrwt. 2 root root 4096 Dec 11 08:02 .font-unix
drwxr-xr-x. 2 root root 4096 Oct 17 00:30 hsperfdata_root
drwxrwxrwt. 2 root root 4096 Dec 11 08:02 .ICE-unix
drwxrwxr-x. 2 root root 4096 Jun 11 2018 locks
drwx------ 2 root root 16384 Mar 22 2018 lost+found
-rw-r--r-- 1 root root 73 Sep 4 00:30 lua_6kWVhi
-rw-r--r-- 1 root root 73 Oct 17 00:30 lua_b1oMqr
-rw-r--r--. 1 root root 73 Nov 1 2018 lua_gZLI4Q
-rw-r--r-- 1 root root 73 Apr 18 2019 lua_LDKmqd
-rw-r--r-- 1 root root 73 Jul 23 00:30 lua_lLceRZ
-rw-r--r--. 1 root root 73 Mar 14 2019 lua_nLd9wV
-rw-r--r--. 1 root root 73 Aug 16 2018 lua_Rgc9Kb
lrwxrwxrwx 1 root root 30 Jan 16 10:43 mysql.sock -> ../../var/lib/mysql/mysql.sock
drwxr-xr-x. 2 root root 4096 Jul 27 2018 process_test
drwx------ 3 root root 4096 Dec 11 08:02 systemd-private-549cbe77dac144afba2ca5eb6f071c17-cups.service-8WQYTS
drwx------ 3 root root 4096 Dec 11 08:02 systemd-private-549cbe77dac144afba2ca5eb6f071c17-cups.service-lUXJUH
drwx------ 3 root root 4096 Dec 11 08:02 systemd-private-549cbe77dac144afba2ca5eb6f071c17-named.service-MYQRzF
drwx------ 3 root root 4096 Dec 11 08:02 systemd-private-549cbe77dac144afba2ca5eb6f071c17-named.service-ZBZebW
drwx------ 3 root root 4096 Nov 29 15:20 systemd-private-ec5a2f1a2cdc4d91913ed1744dfeb7e3-named.service-MwjKxK
drwx------ 3 root root 4096 Nov 29 15:20 systemd-private-ec5a2f1a2cdc4d91913ed1744dfeb7e3-named.service-YgsqEz
drwxrwxrwt. 2 root root 4096 Dec 11 08:02 .Test-unix
drwxrwxrwt. 2 root root 4096 Dec 11 08:02 .X11-unix
drwxrwxrwt. 2 root root 4096 Dec 11 08:02 .XIM-unix

Thank you!

Best regards,
Elizabeta
Is directory /tmp location for some update files for cPanel?

Best regards!
 

Elizabeta

Well-Known Member
Mar 21, 2018
225
31
28
Mostar
cPanel Access Level
Root Administrator
Hello,

I have read this article how to clear tmp directory ? | Web Hosting Talk and they say that "You do need to be careful when deleting files in /tmp. One thing is not to delete mysql.sock if it exists."

So, can I delete my files under /tmp safely? I do not have mysql.sock files under /tmp

Code:
[[email protected] ~]# ls -la /tmp
total 236
drwxrwxrwt. 31 root root 12288 Jan 17 09:12 .
dr-xr-xr-x. 18 root root   273 Jan 17 09:12 ..
-rw-------   1 root root   970 Jan 13 08:39 10313.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.068a65dc.tmp
drwx------   2 root root  4096 Jan 13 08:39 10313.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.89007bd3.tmp
-rw-------   1 root root   970 Sep 11 08:02 10411.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.be5ea661.tmp
drwx------   2 root root  4096 Sep 11 08:02 10411.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.fed84d0a.tmp
-rw-------   1 root root   970 Aug 26 12:40 10571.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.0a9aec6c.tmp
-rw-------   1 root root  3858 Aug 26 12:40 10571.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.1246eb23.tmp
drwx------   2 root root  4096 Aug 26 12:40 10571.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.ddcc57c6.tmp
-rw-------   1 root root   970 Sep  5 13:53 11489.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.a18704ef.tmp
drwx------   2 root root  4096 Sep  5 13:53 11489.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.de06719d.tmp
-rw-------   1 root root  3858 Aug  1 12:09 12691.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.24487523.tmp
-rw-------   1 root root   970 Aug  1 12:09 12691.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.684d489d.tmp
drwx------   2 root root  4096 Aug  1 12:09 12691.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.d698d038.tmp
-rw-------   1 root root   970 Aug 28 09:11 12722.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.20310bb0.tmp
drwx------   2 root root  4096 Aug 28 09:11 12722.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.aebe1593.tmp
drwx------   2 root root  4096 Jul  9  2019 14928.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.5ad10fb1.tmp
-rw-------   1 root root   970 Jul  9  2019 14928.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.a5ffec28.tmp
-rw-------   1 root root  3858 Jul  9  2019 14928.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.e55ff0e7.tmp
-rw-------   1 root root   970 Nov 26 15:30 1997.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.359e5ad2.tmp
drwx------   2 root root  4096 Nov 26 15:30 1997.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.92ab8c5d.tmp
drwx------   2 root root  4096 Sep 17 19:29 23832.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.3df685ba.tmp
-rw-------   1 root root   970 Sep 17 19:29 23832.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.ab068b9b.tmp
-rw-------   1 root root  3858 Jul 16  2019 2516.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.386afda6.tmp
drwx------   2 root root  4096 Jul 16  2019 2516.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.e888a4de.tmp
-rw-------   1 root root   970 Jul 16  2019 2516.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.f016402e.tmp
-rw-------   1 root root   970 Dec 12 10:02 25989.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.9be7f8a7.tmp
drwx------   2 root root  4096 Dec 12 10:02 25989.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.d926ec9c.tmp
drwx------   2 root root  4096 Oct 28 12:04 31515.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.9ab4ff24.tmp
-rw-------   1 root root   970 Oct 28 12:04 31515.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.dd37128f.tmp
-rw-------   1 root root   970 Sep 30 14:21 31541.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.8990cb2e.tmp
drwx------   2 root root  4096 Sep 30 14:21 31541.USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW_.b32f1506.tmp
drwxr-xr-x.  2 abrt abrt  4096 Aug 16  2018 abrt
drwxrwxrwt.  2 root root  4096 Dec 11 08:02 .font-unix
drwxr-xr-x.  2 root root  4096 Oct 17 00:30 hsperfdata_root
drwxrwxrwt.  2 root root  4096 Dec 11 08:02 .ICE-unix
drwxrwxr-x.  2 root root  4096 Jun 11  2018 locks
drwx------   2 root root 16384 Mar 22  2018 lost+found
-rw-r--r--   1 root root    73 Sep  4 00:30 lua_6kWVhi
-rw-r--r--   1 root root    73 Oct 17 00:30 lua_b1oMqr
-rw-r--r--.  1 root root    73 Nov  1  2018 lua_gZLI4Q
-rw-r--r--   1 root root    73 Apr 18  2019 lua_LDKmqd
-rw-r--r--   1 root root    73 Jul 23 00:30 lua_lLceRZ
-rw-r--r--.  1 root root    73 Mar 14  2019 lua_nLd9wV
-rw-r--r--.  1 root root    73 Aug 16  2018 lua_Rgc9Kb
lrwxrwxrwx   1 root root    30 Jan 17 09:10 mysql.sock -> ../../var/lib/mysql/mysql.sock
drwxr-xr-x.  2 root root  4096 Jul 27  2018 process_test
drwx------   3 root root  4096 Dec 11 08:02 systemd-private-549cbe77dac144afba2ca5eb6f071c17-cups.service-8WQYTS
drwx------   3 root root  4096 Dec 11 08:02 systemd-private-549cbe77dac144afba2ca5eb6f071c17-cups.service-lUXJUH
drwx------   3 root root  4096 Dec 11 08:02 systemd-private-549cbe77dac144afba2ca5eb6f071c17-named.service-MYQRzF
drwx------   3 root root  4096 Dec 11 08:02 systemd-private-549cbe77dac144afba2ca5eb6f071c17-named.service-ZBZebW
drwx------   3 root root  4096 Nov 29 15:20 systemd-private-ec5a2f1a2cdc4d91913ed1744dfeb7e3-named.service-MwjKxK
drwx------   3 root root  4096 Nov 29 15:20 systemd-private-ec5a2f1a2cdc4d91913ed1744dfeb7e3-named.service-YgsqEz
Br,
Elizabeta
 
Last edited by a moderator:

quietFinn

Well-Known Member
Feb 4, 2006
1,222
87
178
Finland
cPanel Access Level
Root Administrator
So, can I delete my files under /tmp safely? I do not have mysql.sock files under /tmp
Yes you have:
Code:
lrwxrwxrwx 1 root root 30 Jan 17 09:10 mysql.sock -> ../../var/lib/mysql/mysql.sock
 

quietFinn

Well-Known Member
Feb 4, 2006
1,222
87
178
Finland
cPanel Access Level
Root Administrator
Thank you, i didnˇt notice this.

Is it safe to delete all rest files under /tmp except this mysql.sock?

BR,
Elizabeta
Most likely it is safe.
I just cleared /tmp folder in a DNSONLY server following instructions in this post:
 

Elizabeta

Well-Known Member
Mar 21, 2018
225
31
28
Mostar
cPanel Access Level
Root Administrator
Most likely it is safe.
I just cleared /tmp folder in a DNSONLY server following instructions in this post:
I have read this instruction, maybe to create cron job
this can easily be resolved by adding this to your (root) cron


Code:
0 * * * * /usr/sbin/tmpwatch -am 4 /tmp
This will clean up files that are > 4 hours old

BR,
Elizabeta
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,297
1,251
313
Houston
@Elizabeta

  • tmpwatch is a reasonable solution, if you're using CentOS 6, if it's not installed on the system already you can install it with the following:
    Code:
    yum -y install tmpwatch
    • Once it's installed you may want to modify its configuration, the man page for it may be useful in this instance: tmpwatch(8) - Linux man page

  • If you're on CentOS 7, you shouldn't need to install this to clear tmp files as the tmpfiles.d systemd service should be doing this.

Namely the following:

  • By default the only configuration files which exist are in /usr/lib/tmpfiles.d/*.conf
    • Detailed functions are described in the following:
      • Code:
        /usr/lib/systemd/system/systemd-tmpfiles-clean.timer
        /usr/lib/systemd/system/systemd-tmpfiles-clean.service
        /usr/lib/tmpfiles.d/tmp.conf
    • Configuration files added to /etc/tmpfiles.d/*.conf take precendence over any other configuration files (this isn't created automatically)
    • The default configuration file for this has the following settings:
      Code:
      [[email protected] tmp]# cat /usr/lib/tmpfiles.d/tmp.conf# This file is part of systemd.
      #
      # systemd is free software; you can redistribute it and/or modify it
      # under the terms of the GNU Lesser General Public License as published by
      # the Free Software Foundation; either version 2.1 of the License, or
      # (at your option) any later version.
      
      # See tmpfiles.d(5) for details
      
      # Clear tmp directories separately, to make them easier to override
      v /tmp 1777 root root 10d
      v /var/tmp 1777 root root 30d
      
      # Exclude namespace mountpoints created with PrivateTmp=yes
      x /tmp/systemd-private-%b-*
      X /tmp/systemd-private-%b-*/tmp
      x /var/tmp/systemd-private-%b-*
      X /var/tmp/systemd-private-%b-*/tmp
  • To create a custom version of this you'd copy this to /etc/tmpfiles.d/tmp.conf
    Code:
    cp /usr/lib/tmpfiles.d/tmp.conf /etc/tmpfiles.d/
    • Configure as you'd like it to function - as an example I configured mine as follows:
      Code:
      [[email protected] tmpfiles.d]# cat /etc/tmpfiles.d/tmp.conf
      # This file is part of systemd.
      #
      # systemd is free software; you can redistribute it and/or modify it
      # under the terms of the GNU Lesser General Public License as published by
      # the Free Software Foundation; either version 2.1 of the License, or
      # (at your option) any later version.
      
      # See tmpfiles.d(5) for details
      
      # Clear tmp directories separately, to make them easier to override
      v /tmp 1777 root root 4h
      v /var/tmp 1777 root root 5d
      
      # Exclude namespace mountpoints created with PrivateTmp=yes
      x /tmp/systemd-private-%b-*
      X /tmp/systemd-private-%b-*/tmp
      x /var/tmp/systemd-private-%b-*
      X /var/tmp/systemd-private-%b-*/tmp
    • this will run automatically but to run it manually you can do the following:
      Code:
      systemd-tmpfiles --clean
For more information and configuration details check out the man page: tmpfiles.d(5) - Linux manual page
 

Elizabeta

Well-Known Member
Mar 21, 2018
225
31
28
Mostar
cPanel Access Level
Root Administrator
Hello Lauren,

I have Red Hat Enterprise Linux Server release 7.7 installed on server DNS-only. Could I just delete files under /tmp or is it not recomended at all?

Br,
Elizabeta
 

quietFinn

Well-Known Member
Feb 4, 2006
1,222
87
178
Finland
cPanel Access Level
Root Administrator
If I understand the default configuration right it deletes only files older than 10 days, and excluding systemd-private-%b-* & systemd-private-%b-*/tmp
 
  • Like
Reactions: cPanelLauren

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,297
1,251
313
Houston
Hello @Elizabeta

Can you show me the configuration file for systemd-tmpfiles at /etc/tmpfiles.d/tmp.conf (if you made customizations) If you didn't: /usr/lib/tmpfiles.d/tmp.conf

and the output of the following?

Code:
ls -lah /tmp
Code:
ls -lah /var/tmp
(remove any identifying information before posting here)
 

Elizabeta

Well-Known Member
Mar 21, 2018
225
31
28
Mostar
cPanel Access Level
Root Administrator
Hello Lauren,


Code:
[[email protected] tmp]# more /usr/lib/tmpfiles.d/tmp.conf
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.
# See tmpfiles.d(5) for details
# Clear tmp directories separately, to make them easier to override
v /tmp 1777 root root 10d
v /var/tmp 1777 root root 30d
# Exclude namespace mountpoints created with PrivateTmp=yes
x /tmp/systemd-private-%b-*
X /tmp/systemd-private-%b-*/tmp
x /var/tmp/systemd-private-%b-*
X /var/tmp/systemd-private-%b-*/tmp
Code:
[[email protected] tmp]# ls -lah /tmp
total 112K
drwxrwxrwt. 19 root root  12K Jan 22 08:20 .
dr-xr-xr-x. 18 root root  273 Jan 22 08:14 ..
-rw-------   1 root root  970 Sep  5 13:53 11489._USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW__.a18704ef.tmp
drwx------   2 root root 4.0K Sep  5 13:53 11489._USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW__.de06719d.tmp
-rw-------   1 root root 3.8K Aug  1 12:09 12691._USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW__.24487523.tmp
-rw-------   1 root root  970 Aug  1 12:09 12691._USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW__.684d489d.tmp
drwx------   2 root root 4.0K Aug  1 12:09 12691._USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW__.d698d038.tmp
-rw-------   1 root root  970 Jan 21 10:32 877._USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW__.917758d4.tmp
drwx------   2 root root 4.0K Jan 21 10:32 877._USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW__.dac510f7.tmp
drwxr-xr-x.  2 abrt abrt 4.0K Aug 16  2018 abrt
drwxrwxrwt.  2 root root 4.0K Jan 20 15:34 .font-unix
drwxr-xr-x.  2 root root 4.0K Jan 22 00:31 hsperfdata_root
drwxrwxrwt.  2 root root 4.0K Jan 20 15:34 .ICE-unix
-rw-rw-r--   1 root root    0 Jan 20 15:35 ICRC_ROLL.lck
drwxrwxr-x.  2 root root 4.0K Jun 11  2018 locks
drwx------   2 root root  16K Mar 22  2018 lost+found
-rw-r--r--   1 root root   73 Jan 22 00:31 lua_BRMD1U
lrwxrwxrwx   1 root root   30 Jan 22 08:20 mysql.sock -> ../../var/lib/mysql/mysql.sock
drwxr-xr-x.  2 root root 4.0K Jul 27  2018 process_test
drwx------   3 root root 4.0K Jan 20 15:35 systemd-private-32406dac373148379c06e18364e46cde-cups.service-Xam4Tz
drwx------   3 root root 4.0K Jan 20 15:35 systemd-private-32406dac373148379c06e18364e46cde-cups.service-YjAzWM
drwx------   3 root root 4.0K Jan 20 15:35 systemd-private-32406dac373148379c06e18364e46cde-named.service-dCTmjr
drwx------   3 root root 4.0K Jan 20 15:35 systemd-private-32406dac373148379c06e18364e46cde-named.service-oOOCE7
drwxrwxrwt.  2 root root 4.0K Jan 20 15:34 .Test-unix
drwxrwxrwt.  2 root root 4.0K Jan 20 15:34 .X11-unix
drwxrwxrwt.  2 root root 4.0K Jan 20 15:34 .XIM-unix

Code:
[[email protected] tmp]# ls -lah /var/tmp
total 116K
drwxrwxrwt. 19 root root  12K Jan 22 08:20 .
drwxr-xr-x. 22 root root 4.0K Jan 21 10:32 ..
-rw-------   1 root root  970 Sep  5 13:53 11489._USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW__.a18704ef.tmp
drwx------   2 root root 4.0K Sep  5 13:53 11489._USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW__.de06719d.tmp
-rw-------   1 root root 3.8K Aug  1 12:09 12691._USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW__.24487523.tmp
-rw-------   1 root root  970 Aug  1 12:09 12691._USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW__.684d489d.tmp
drwx------   2 root root 4.0K Aug  1 12:09 12691._USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW__.d698d038.tmp
-rw-------   1 root root  970 Jan 21 10:32 877._USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW__.917758d4.tmp
drwx------   2 root root 4.0K Jan 21 10:32 877._USR_LOCAL_CPANEL_SCRIPTS_UPDATENOW__.dac510f7.tmp
drwxr-xr-x.  2 abrt abrt 4.0K Aug 16  2018 abrt
drwxrwxrwt.  2 root root 4.0K Jan 20 15:34 .font-unix
drwxr-xr-x.  2 root root 4.0K Jan 22 00:31 hsperfdata_root
drwxrwxrwt.  2 root root 4.0K Jan 20 15:34 .ICE-unix
-rw-rw-r--   1 root root    0 Jan 20 15:35 ICRC_ROLL.lck
drwxrwxr-x.  2 root root 4.0K Jun 11  2018 locks
drwx------   2 root root  16K Mar 22  2018 lost+found
-rw-r--r--   1 root root   73 Jan 22 00:31 lua_BRMD1U
lrwxrwxrwx   1 root root   30 Jan 22 08:20 mysql.sock -> ../../var/lib/mysql/mysql.sock
drwxr-xr-x.  2 root root 4.0K Jul 27  2018 process_test
drwx------   3 root root 4.0K Jan 20 15:35 systemd-private-32406dac373148379c06e18364e46cde-cups.service-Xam4Tz
drwx------   3 root root 4.0K Jan 20 15:35 systemd-private-32406dac373148379c06e18364e46cde-cups.service-YjAzWM
drwx------   3 root root 4.0K Jan 20 15:35 systemd-private-32406dac373148379c06e18364e46cde-named.service-dCTmjr
drwx------   3 root root 4.0K Jan 20 15:35 systemd-private-32406dac373148379c06e18364e46cde-named.service-oOOCE7
drwxrwxrwt.  2 root root 4.0K Jan 20 15:34 .Test-unix
drwxrwxrwt.  2 root root 4.0K Jan 20 15:34 .X11-unix
drwxrwxrwt.  2 root root 4.0K Jan 20 15:34 .XIM-unix
Code:
[[email protected] tmp]# df -h
..........
..........
/dev/loop0 951M 1.4M 901M 1% /tmp
Directory /tmp is not big, but I have requirements for backup via commvault that that directory should have min 1024MB ...
I have warnings on commvault backup server [/tmp] does not have required minimum space of [1024] MB. The space available is [901] MB.

I would like just empty that directory to 1024MB available. Which is recommeded option to solve this problem, just delete content of /tmp or??

Thank you!

Best regards,
Elizabeta
 
Last edited by a moderator:

quietFinn

Well-Known Member
Feb 4, 2006
1,222
87
178
Finland
cPanel Access Level
Root Administrator
[[email protected] tmp]# df -h
..........
..........
/dev/loop0 951M 1.4M 901M 1% /tmp

Directory /tmp is not big, but I have requirements for backup via commvault that that directory should have min 1024MB ...
I have warnings on commvault backup server [/tmp] does not have required minimum space of [1024] MB. The space available is [901] MB.

I would like just empty that directory to 1024MB available. Which is recommeded option to solve this problem, just delete content of /tmp or??
size of /tmp is 951MB, so even if you delete everything in /tmp there will be only 951MB free in it.
Maybe it's possible to configure commvault to use another location instead of /tmp
 
  • Like
Reactions: cPanelLauren