Skip to main content

How to trigger AFT! jobs from the command line

AsAFT! provides two commands for running scripts from a shell or a CI/CD pipeline.

ofwhatever actuallycall
CommandWhat it does
aft startCalls the REST API of versiona 3.0, Syncplify.merunning AFT! hasinstance addedand queues the capabilityjob there. The script runs inside the service, with full access to startthe jobsVFS viaLibrary and secrets. Returns immediately; the STARTjob command-line switch and parameters. To be clear, unlike the RUN command (which executes a script from fileruns in the contextbackground.
aft runExecutes a .syncjs file directly in the calling shell youprocess. invokedNo it)API key needed. The script runs to completion before the START command willreturns.

aft start: trigger a RESTstored script via API

for you to start the job within the context of the Syncplify.me AFT! system service.

Prerequisite

First of all, you need to make sure you meet the prerequisites, which is basically only one: you need to createCreate an API Keykey fromin insidethe AFT!'s web interface,UI andunder makeSettings > API Keys. Make sure suchthe APIkey's KeyIP canallowlist includes the machine you will be usedcalling from. For calls from the IPsame address you'll be calling it from. Here's an example API Key that will work when invoked frommachine, 127.0.0.1 (localhost):is sufficient.

image.pngimage.png

Minimal example

Once you have the API Key, you can use it to invoke the START command via command-line.Linux/MacOS:

./aft start -n "My Backup Job" -a "xiM2ruBm2QZkhTSN6BPd9BqmxVEBVbrgNYVMkNQb6hfj"

Here'sWindows the simplest example, using only the API Key and the ID of the script you want to run:(PowerShell):

.\aft.exe start -sn "p3fEoexohdHj6SXrvuT8H8"My Backup Job" -a "xiM2ruBm2QZkhTSN6BPd9BqmxVEBVbrgNYVMkNQb6hfj"

OnceScript younames haveare thematched API Key, you can use it to invoke the START command via command-line.case-insensitively.

Here's

With parameters and a completeremote example,instance
which

Linux/MacOS:

also
aft explicitlystart adds\
  the-n optional"My HOSTBackup andJob" PARAMETERS\
  command-line-a payload:"xiM2ruBm2QZkhTSN6BPd9BqmxVEBVbrgNYVMkNQb6hfj" \
  --params '{"character":"goofy"}' \
  --host "192.168.1.10:44399"

Windows (PowerShell):

.\aft.exe start `
  -sn "p3fEoexohdHj6SXrvuT8H8"My Backup Job" `
  -a "xiM2ruBm2QZkhTSN6BPd9BqmxVEBVbrgNYVMkNQb6hfj" `
  --params '{"[{\character":"goofy"}' `"name\`":\`"character\`",\`"value\`":\`"goofy\`"}]"
  --host "127.0.0.1:192.168.1.10:44399"

BothInside ofthe thesescript, examplesread assumethe you'reparameter invokingwith themParam("character").

from

--host PowerShell...defaults pleaseto keep127.0.0.1:44399 when omitted.

aft run: execute a script file directly

The Allow CLI Run option must be enabled in mindAFT! Settings. It is disabled by default but an administrator can enable it.

Minimal example

Linux/MacOS:

./aft run -f "/opt/scripts/my-transfer.syncjs"

Windows (PowerShell):

.\aft.exe run -f "C:\Scripts\my-transfer.syncjs"
With parameters

Linux/MacOS:

./aft run -f "/opt/scripts/my-transfer.syncjs" -p '{"destination":"/archive/2026"}'

Windows (PowerShell):

.\aft.exe run -f "C:\Scripts\my-transfer.syncjs" -p '{"destination":"D:\Archive\2026"}'
Notes
  • aft run executes synchronously: the command blocks until the script finishes and exits with code 0 on success, or code 1 if the script crashes or fails.
  • If aft serve is running on the same machine, aft run automatically delegates to the running service so the script has full access to the VFS Library and secrets. If aft serve is not running, it opens the local database directly.
  • This makes aft run a natural fit for OS-cron jobs, CI/CD pipelines, and shell scripts that otherneed shellsa (likedefinitive cmd.exeexit orcode.
  • Unix/Linux shells) may have different string "escaping" mechanisms and notations.