The view_transfer Script

Valid for versions 82 through the latest version

Version:

82

Last modified: August 15, 2022


Overview

The /usr/local/cpanel/bin/view_transfer script lets you view the logs for a transfer or restore session. These logs include the sessions for transfers and restored backups run via WHM’s Transfer Tool interface (WHM » Home » Transfers » Transfer Tool). You can also restore backups with WHM’s Backup Restoration interface (WHM » Home » Backup » Backup Restoration) or by running the restorepkg script.

Important:

You must run this script as the root user.

Note:
  • To view the previous sessions, use the view_transfer script with those sessions’ session IDs. You can also use WHM’s Review Transfers and Restores interface (WHM » Home » Transfers » Review Transfers and Restores).
  • The WHM API 1 fetch_transfer_session_log function produces a similar output.

Run the script

To run this script on the command line, use the following format:

/usr/local/cpanel/bin/view_transfer sessionID [options]
Note:

In this example, sessionID is a transfer session’s ID.

Options

Use the following options with this script:

Options
Description Example
sessionID Required.
The transfer session’s ID.
10138174noroo20210208141143HpwEjUkwe
logfile A transfer session’s log file. When you use this option, the script prints the log file’s contents in a human-readable format. This option accepts the following log file formats:
  • The transfer session’s log file name.
  • master.log — The transfer session’s master log file.
  • master.error_log — The transfer session’s the error log file.
item-TRANSFER_AccountRemoteUser_username
--overview Only return an overview of the transfer’s progress. The script will not output the transfer’s progress status details.
Note:
This option does not change the script’s output if you run the script with a log file.
--overview

Example

To view a transfer session ID and its log file’s contents, use the following format:

/usr/local/cpanel/bin/view_transfer 10138174noroo20210208141143HpwEjUkwe item-TRANSFER_AccountRemoteUser_username

The script’s output will resemble the following example:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
The transfer for session ID “10138174noroo20210208141143HpwEjUkwe” is complete.
Progress: 0% (2021-02-08 08:11:45 -0600)
Starting “TRANSFER” for “Account” “username”.
Attempting to copy “username” from “10.1.38.174”.
Trying to fetch cpmove file via cPanel API!
Fetching current backups from remote server …    0 backups found.
done.
Starting the backup …
Invalid log entry: [debug: Established cpanel session
]
Remote backup started (PID 15272)
Progress: 20% (2021-02-08 08:11:46 -0600)
done.
Checking remote server for backups …    1 backup found.
The remote server is creating the backup file “backup-2.8.2021_08-11-46_username.tar.gz”.
Progress: 25% (2021-02-08 08:11:51 -0600)
Progress: 35% (2021-02-08 08:11:51 -0600)
Downloading “backup-2.8.2021_08-11-46_username.tar.gz” …
done.
extract dir name is: backup-2.8.2021_08-11-46_username
Progress: 80% (2021-02-08 08:11:52 -0600)
Progress: 100% (2021-02-08 08:11:52 -0600)
Success.

Additional Documentation