Erase unused transfer sessions
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:
Is there a safe way to remove these sessions including from the WHMxfer database? Thank you.
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.
-
If they are not in use, just delete them from the filesystem directly. It won't break anything. 0 -
Hello, You may also find the following WHM API 1 function useful if you want to verify the transfer session has ended before deleting those files: WHM API 1 Functions - get_transfer_session_state - Software Development Kit - cPanel Documentation Thank you. 0 -
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 : whmapi1 get_transfer_session_state transfer_session_id=MY_ID
Force the session to abort:whmapi1 abort_transfer_session transfer_session_id=MY_ID
Enter the sqlite database:cd /var/cpanel/transfer_sessions/ sqlite3 whmxfer.sqlite
Show tables:.tables
Show table structure:.schema sessions
Delete by session ID:DELETE from sessions WHERE sessionid = 'DELETE_SESSION_BY_SESSION_ID_ENTRY';
Delete by PID:DELETE from sessions WHERE pid= 'MY_PID';
Hope this helps someone.0
Please sign in to leave a comment.
Comments
3 comments