Erase unused transfer sessions

Havri

Well-Known Member
Oct 28, 2013
86
19
8
cPanel Access Level
Root Administrator
Hello,

I was trying out a few things with the WHM API and saw that a lot of transfer sessions were created. I found the in /var/cpanel/transfer_sessions:

Code:
drwx------   2 root root  4096 Jun  6 19:45 1761262021copya20170606154006hwq0XOI/
drwx------   2 root root  4096 Jun  7 11:10 1921681051copya20170607081037Y5TBXMo/
drwx------   2 root root  4096 Jun  7 11:12 1921681051copya2017060708123400MK85q/
drwx------   2 root root  4096 Jun  7 11:15 1921681051copya20170607081457W7U2o0A/
drwx------   2 root root  4096 Jun  7 11:24 1921681051copya20170607082447J1vqVPP/
drwx------   2 root root  4096 Jun  7 11:25 1921681051copya20170607082535P336o8Z/
drwx------   2 root root  4096 Jun  7 11:26 1921681051copya20170607082618OqD2Md4/
drwx------   2 root root  4096 Jun  7 11:26 1921681051copya2017060708265565ckz0J/
drwx------   2 root root  4096 Jun  7 12:07 1921681051copya20170607090755lqheY71/
drwx------   2 root root  4096 Jun  7 13:46 1921681051copya201706070909476skYaIb/
-rw-------   1 root root  5120 Jun  7 12:09 whmxfer.sqlite
Is there a safe way to remove these sessions including from the WHMxfer database?

Thank you.
 

Havri

Well-Known Member
Oct 28, 2013
86
19
8
cPanel Access Level
Root Administrator
Hello,

I'll do a follow-up on this thread. My initial question was somehow inexact. The thing that I wanted to do is a "cleanup" of the entries in WHM -> Review Transfers and Restores. In my case, I did some tests using the transfer tool and some were successful and some failed, while others were blocked in "ABORTING" state. To clean this up, I did the following steps:

Check if the transfer session is running. You can get the transfer session id from WHM -> Review Transfers and Restores :
Code:
whmapi1 get_transfer_session_state transfer_session_id=MY_ID
Force the session to abort:
Code:
whmapi1 abort_transfer_session transfer_session_id=MY_ID
Enter the sqlite database:
Code:
cd /var/cpanel/transfer_sessions/

sqlite3 whmxfer.sqlite
Show tables:
Code:
.tables
Show table structure:
Code:
.schema sessions
Delete by session ID:
Code:
DELETE from sessions WHERE sessionid = 'DELETE_SESSION_BY_SESSION_ID_ENTRY';
Delete by PID:
Code:
DELETE from sessions WHERE pid= 'MY_PID';
Hope this helps someone.
 
  • Like
Reactions: cPanelMichael