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/',
});
Option Description
src Source path
dst Destination path
flags Additional rsync flags
remove Remove extra files on destination
user / group Ownership settings
usermap / groupmap User/group mapping
rsyncPath Custom rsync binary path

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