Skip to content

rsync

import { rsyncPush, rsyncPull } from 'sysopkit/op/rsync';

IDEMPOTENT

Syncs local to remote. Returns array of change entries.

const changes = await rsyncPush({
src: '/local/path/',
dst: '/remote/path/',
flags: ['-az', '--delete'],
});

IDEMPOTENT

Syncs remote to local.

const changes = await rsyncPull({
src: '/remote/path/',
dst: '/local/path/',
});
OptionDescription
srcSource path
dstDestination path
flagsAdditional rsync flags
removeRemove extra files on destination
user / groupOwnership settings
usermap / groupmapUser/group mapping
rsyncPathCustom rsync binary path

Return type: RsyncEntry[] with type, action (sent/created/touched/deleted), and path.