Skip to content

Commit 7ac4060

Browse files
authored
Merge pull request #76 from hkuno9000/exclude-option
Feat: add exclude option
2 parents 8b22bea + ed0732f commit 7ac4060

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

rpi-clone

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ usage: $PGM sdN {-v|--verbose} {-f|--force-initialize} {-f2}
9898
{-L|--label-partitions label} {-l|--leave-sd-usb-boot}
9999
{-a|--all-sync} {-F|--Force-sync} {-x} {-V|--version}
100100
{--convert-fstab-to-partuuid}
101+
{--exclude=PATTERN} {--exclude-from=FILE}
101102
102103
-v - verbose rsync, list all files as they are copied.
103104
-f - force initialize the destination disk by imaging the booted disk
@@ -290,6 +291,7 @@ rsync_file_system()
290291
if [ "$3" == "with-root-excludes" ]
291292
then
292293
rsync $rsync_options --delete \
294+
$exclude_useropt \
293295
$exclude_swapfile \
294296
--exclude '.gvfs' \
295297
--exclude '/dev/*' \
@@ -303,6 +305,7 @@ rsync_file_system()
303305
$dst_dir
304306
else
305307
rsync $rsync_options --delete \
308+
$exclude_useropt \
306309
--exclude '.gvfs' \
307310
--exclude 'lost\+found/*' \
308311
$src_dir \
@@ -783,6 +786,9 @@ do
783786
quiet=1
784787
rsync_options=${rsync_options}q
785788
;;
789+
--exclude=*|--exclude-from=*)
790+
exclude_useropt="${exclude_useropt} $1"
791+
;;
786792
-s|--setup)
787793
shift
788794
if ! command -v $setup_command > /dev/null

0 commit comments

Comments
 (0)