Sync Runs

A SyncRun represents a single execution (run) of a Sync job. It tracks status, statistics, logs, and timing for each sync operation.

List Sync Runs

SDK Function

SyncRun.list()

Return Object

ListIterator<SyncRun>

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Function Arguments

ArgumentDescription
user_id
int64
User ID. Provide a value of 0 to operate the current session's user.

Additional Arguments

Example Request

import com.files.ListIterator;
import com.files.exceptions.*;
import com.files.exceptions.ApiErrorException.*;
import com.files.models.SyncRun;

try {
  HashMap<String, Object> parameters = new HashMap<>();
  parameters.put("user_id", 1);
  
  ListIterator<SyncRun> syncRuns = SyncRun.list(parameters);
  for (SyncRun syncRun : syncRuns.listAutoPaging()) {
    // Operate on syncRun
  }
} catch (NotAuthenticatedException e) {
  System.out.println("Authentication Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
} catch (SdkException e) {
  System.out.println("Unknown Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
}

Show Sync Run

SDK Function

SyncRun.find()

Return Object

SyncRun

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Function Arguments

ArgumentDescription
id
int64
Required
Sync Run ID.

Example Request

import com.files.exceptions.*;
import com.files.exceptions.ApiErrorException.*;
import com.files.models.SyncRun;

try {
  HashMap<String, Object> parameters = new HashMap<>();
  SyncRun syncRun = SyncRun.find(id, parameters);
  // Operate on syncRun
} catch (NotAuthenticatedException e) {
  System.out.println("Authentication Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
} catch (SdkException e) {
  System.out.println("Unknown Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
}

The SyncRun Object

Some of the functions above return a SyncRun object. The attributes of this object are listed below.

AttributeDescription
id
int64
SyncRun ID
body
string
Log or summary body for this run
bytes_synced
int64
Total bytes synced in this run
compared_files
int64
Number of files compared
compared_folders
int64
Number of folders compared
completed_at
date-time
When this run was completed
created_at
date-time
When this run was created
dest_remote_server_type
string
Destination remote server type, if any
Possible values: ftp, sftp, s3, google_cloud_storage, webdav, wasabi, backblaze_b2, one_drive, box, dropbox, google_drive, azure, sharepoint, s3_compatible, azure_files, files_agent, filebase, cloudflare, linode, files_com
dry_run
boolean
Whether this run was a dry run (no actual changes made)
errored_files
int64
Number of files that errored
estimated_bytes_count
int64
Estimated bytes count for this run
event_errors
array(string)
Array of errors encountered during the run
log_url
string
Link to external log file.
runtime
double
Total runtime in seconds
site_id
int64
Site ID
workspace_id
int64
Workspace ID
src_remote_server_type
string
Source remote server type, if any
Possible values: ftp, sftp, s3, google_cloud_storage, webdav, wasabi, backblaze_b2, one_drive, box, dropbox, google_drive, azure, sharepoint, s3_compatible, azure_files, files_agent, filebase, cloudflare, linode, files_com
status
string
Status of the sync run (success, failure, partial_failure, in_progress, skipped)
Possible values: success, failure, partial_failure, in_progress, skipped
successful_files
int64
Number of files successfully synced
sync_id
int64
ID of the Sync this run belongs to
sync_name
string
Name of the Sync this run belongs to
updated_at
date-time
When this run was last updated
live_transfers
array(object)
Array of in-progress file transfers with progress data. Only present when the sync run status is in_progress.