GDAL-VSI-SYNC(1)
π GDAL-VSI-SYNC π
okay bestie, this is the gdal-vsi-sync page from the GDAL manual and it is lowkey iconic β it's all about syncing files across the GDAL Virtual System Interface (VSI). it landed in version 3.11, so it's a fresh queen. let's get into it π«Ά
β¨ NAME β¨
gdal-vsi-sync β synchronize source and target file/directory located on GDAL Virtual System Interface (VSI)
and yes, Added in version 3.11. π
π SYNOPSIS π
Usage: gdal vsi sync [OPTIONS] <SOURCE> <DESTINATION>
Synchronize source and target file/directory located on GDAL Virtual System Interface (VSI).
Positional arguments:
--source <SOURCE> Source file or directory name [required]
--destination <DESTINATION> Destination file or directory name [required]
Common Options:
-h, --help Display help message and exit
--json-usage Display usage as JSON document and exit
--config <KEY>=<VALUE> Configuration option [may be repeated]
-q, --quiet Quiet mode (no progress bar or warning message) [not available in pipelines]
Options:
-r, --recursive Synchronize recursively
--strategy <STRATEGY> Synchronization strategy. STRATEGY=timestamp|ETag|overwrite (default: timestamp)
-j, --num-threads <NUM-THREADS> Number of jobs (or ALL_CPUS)
like, look at that syntax. <SOURCE> and <DESTINATION>? both required, no cap. π
π¦ DESCRIPTION π¦
so gdal vsi sync synchronizes files and directories living on GDAL Virtual File Systems β think compressed, network hosted, etc... β like /vsimem, /vsizip, /vsitar, /vsicurl, .... π
it's an analog to the UNIX rsync command, fr fr. but here's the tea: in the current implementation, rsync would actually be more efficient for local file copying. the real main character energy of gdal vsi sync shows up when the source or target is a remote file system like /vsis3/ or /vsigs/, because then it can take into account the timestamps of the files (or optionally the ETag/MD5Sum) to avoid unneeded copy operations. slay, no wasted work. β¨
this is implemented efficiently for:
- local filesystem <--> remote filesystem. π
- remote filesystem <--> remote filesystem, where the source and target remote filesystems are the same and one of
/vsis3/,/vsigs/or/vsiaz/. Or when the target is/vsiaz/and the source is/vsis3/,/vsigs/,/vsiadls/or/vsicurl/π₯
similarly to rsync behavior, if the source filename ends with a slash, it means that the content of the directory must be copied, but not the directory name. for example, assuming /home/even/foo contains a file bar, gdal vsi sync -r /home/even/foo/ /mnt/media will create a /mnt/media/bar file. whereas gdal vsi sync -r /home/even/foo /mnt/media will create a /mnt/media/foo directory which contains a bar file. that trailing slash is doing SO much work, iykyk. πΈ
and this is implemented by VSISync().
π Options π
-r,--recursiveβ Synchronize recursively. go all the way down, bestie. π³οΈ--strategy timestamp|ETag|overwriteβ decides which criterion is used to determine if a target file must be replaced when it already exists and has the same file size as the source. Only applies for a source or target being a network filesystem. π°οΈ
the default is timestamp (similarly to how aws s3 sync works). For an upload operation, a remote file is replaced if it has a different size or if it is older than the source. For a download operation, a local file is replaced if it has a different size or if it is newer than the remote file. π
the ETag strategy assumes that the ETag metadata of the remote file is the MD5Sum of the file content, which is only true in the case of /vsis3/ for files not using KMS server side encryption and uploaded in a single PUT operation (so smaller than 50 MB given the default used by GDAL). Only to be used for /vsis3/, /vsigs/ or other filesystems using a MD5Sum as ETAG. β οΈ don't just spray this everywhere, it's a specific girlie.
the overwrite strategy will always overwrite the target file with the source one. no thoughts, head empty, just replace. π
-j,--num-threads <value>β Number of jobs to run at once. multitasking queen π (and the SYNTAX up top says it can beALL_CPUStoo, so go feral.)
π RETURN STATUS CODE π
the program returns status code 0 in case of success, and non-zero in case of error (non-blocking errors emitted as warnings are considered as a successful execution). so like, a warning is NOT a fail, it's just a little warning β¨
π EXAMPLES π
β Example 1: Synchronize a local directory onto a S3 bucket β
$ gdal vsi sync -r my_directory/ /vsis3/bucket/my_directory
look at her go. π
π AUTHOR π
Even Rouault <even.rouault@spatialys.com>
π COPYRIGHT π
1998-2026
and that's the whole page, bestie π«Ά this was the GDAL-VSI-SYNC(1) manual β GDAL-flavored, dated Aug 18, 2026. go sync something and make it everybody's problem π
β¨πΈ
π¦ where this page comes from
- alpine 3.24: gdal-doc 3.13.3-r0 Β· MIT
- arch rolling: gdal 3.13.3-6 Β· MIT
- ubuntu stonking: gdal-bin 3.13.3+dfsg-1ubuntu4 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms