Syncing
$ filen sync [sync pairs...] [--continuous]
Invoke filen sync to sync any locations with your Filen Drive. This is the same functionality you get with the Desktop app.
You must specify the sync pairs ([sync pairs...] above) as follows:
- (central registry)
filen sync: Read the sync pairs fromsyncPairs.json(inside the data dir). This file must contain JSON of the type{local: string, remote: string, syncMode: string, alias?: string, disableLocalTrash?: boolean, ignore?: string[], excludeDotFiles?: boolean}[](this is a TypeScript type definition, where?means an optional field). See below forsyncModevalues. - (custom registry)
filen sync <file>: Read the sync pairs from a custom JSON file (same type as above). - (aliases)
filen sync mypair myotherpair: Sync the sync pairs from the central registry that were given the aliasesmypairandmyotherpair. - (literal pair)
filen sync /local/path:twoWay:/cloud/path: Sync the local path/local/pathwith the cloud path/cloud/pathin two-way sync. - (shorthand for two-way pairs)
filen sync /local:/cloud: Sync/localwith/cloudin two-way sync. - (other sync modes and abbreviations)
filen sync /local1:localToCloud:/cloud1 /local2:ltc:/cloud2: Sync/local1with/cloud1(and/local2with/cloud2) in local-to-cloud sync. See below for more abbreviations. - (disable local trash)
filen sync /local:/cloud --disable-local-trash: Disable local trash
You can set the --continuous flag to keep syncing (instead of only syncing once).
Example of sync pairs registry:
[
{
"local": "/home/user/Pictures",
"remote": "/Pictures",
"syncMode": "cloudBackup"
},
{
"local": "/home/user/Documents",
"remote": "/Documents",
"syncMode": "twoWay",
"alias": "documents",
"disableLocalTrash": true,
"ignore": ["example.txt", "*.log"],
"excludeDotFiles": true
}
]
Note that since this is a JSON file, backslashes (\) in strings need to be escaped, e. g. "C:\\some\\path").
Sync Modes
- Two Way (
twoWay,tw)
Mirror every action in both directions.
Renaming, deleting & moving is applied to both sides. - Local to Cloud (
localToCloud,ltc)
Mirror every action done locally to the cloud but never act on cloud changes.
Renaming, deleting & moving is only transferred to the cloud, but not the other way around. - Local Backup (
localBackup,lb)
Only upload data to the cloud, never delete anything or act on cloud changes.
Renaming & moving is transferred to the cloud, but not local deletions. - Cloud To Local (
cloudToLocal,ctl)
Mirror every action done in the cloud locally but never act on local changes.
Renaming, deleting & moving is only transferred to the local side, but not the other way around. - Cloud Backup (
cloudBackup,cb)
Only download data from the cloud, never delete anything or act on local changes.
Renaming & moving is transferred to the local side, but not cloud deletions.