# dietpi-sync dry run option not working

**URL:** <https://dietpi.com/forum/t/dietpi-sync-dry-run-option-not-working/2797>\
**Category:** Troubleshooting\
**Created:** [22 December 2018 13:03 UTC](https://dietpi.com/forum/t/dietpi-sync-dry-run-option-not-working/2797 "2018-12-22T13:03:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![WilburWalsh](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/w/c77e96/32.png) [@WilburWalsh](https://dietpi.com/forum/u/WilburWalsh)\
**Post date:** [22 December 2018 13:03 UTC](https://dietpi.com/forum/t/dietpi-sync-dry-run-option-not-working/2797/1 "2018-12-22T13:03:19Z")

</div>

Hi,

first of all I want to thank the developers of DietPi for their amazing work. A couple of days ago I digged out my old RPi 1 and came across your site while searching for an adequate distro. Since then I have been playing around with it and setup my system. Mostly everything worked out fine straight away. Good job, guys!

So, now regarding the problem: Today I wanted to setup a backup of my system and started dietpi-sync. After setting the configurations to my needs, I wanted to check with a dry run and used that option from within dietpi-sync. After some strange error messages at the start of the run and rsync actually copying files, I checked your script and found a bug in the way you set up the rsync options:

```nohighlight
			#Rsync options
			local rync_options+="-aHP4 --info=name0 --info=progress2 --human-readable --delete-excluded --exclude-from=$FP_FILTER_INCLUDE_EXCLUDE --log-file=$FP_LOG "

			# - Compression?
			if (( $SYNC_COMPRESSION )); then

				rync_options+='z'

			fi

			# - Dry Run?
			if (( $SYNC_DRY_RUN )); then

				rync_options+='n'

			fi

			# - Delete mode?
			if (( $SYNC_DELETE_MODE )); then

				rync_options+=' --delete'

			fi

```

By simply adding ‘z’ and/or ‘n’ to the options string you mess everything up, because now there is no more leading ‘-’. Seems to me as those options were forgotten when you re-arranged the options string at some point. Changing the ‘n’ to ’ --dry-run’ fixed it for me.

Oh, I’m running on v6.19.7 | RPi B (armv6l)

I hope this is some useful information for you. Thanks again for the great work!

---

<div class="post-metadata">

**Author:** ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)\
**Post date:** [23 December 2018 16:05 UTC](https://dietpi.com/forum/t/dietpi-sync-dry-run-option-not-working/2797/2 "2018-12-23T16:05:21Z")

</div>

WilburWalsh  
Many thanks for your report. Damn this bug was already introduced on v6.15: [https://github.com/Fourdee/DietPi/commit/a05040fb23696260caf0954854bab58a4ef44296#diff-9d118ba1c404813c165a4a35cfb5fa47](https://github.com/Fourdee/DietPi/commit/a05040fb23696260caf0954854bab58a4ef44296#diff-9d118ba1c404813c165a4a35cfb5fa47)

- And no one recognized until now… We really need to merge dietpi-sync and dietpi-backup into one script…

Will be fixed with v6.20!  
PR is up: [https://github.com/Fourdee/DietPi/pull/2366](https://github.com/Fourdee/DietPi/pull/2366)

- Some other enhancements are inside.

Would be great if you can help testing it bullet prove:

```nohighlight
wget https://raw.githubusercontent.com/Fourdee/DietPi/dietpi-sync/dietpi/dietpi-sync -O /DietPi/dietpi/dietpi-sync
chmod +x /DietPi/dietpi/dietpi-sync

```

---

<div class="post-metadata">

**Author:** ![WilburWalsh](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/w/c77e96/32.png) [@WilburWalsh](https://dietpi.com/forum/u/WilburWalsh)\
**Post date:** [23 December 2018 21:57 UTC](https://dietpi.com/forum/t/dietpi-sync-dry-run-option-not-working/2797/3 "2018-12-23T21:57:14Z")

</div>

MichaIng  
Tested it and works fine here in both dry run and real run situations.

But I‘m afraid a typo sneeked in in line 279:

```nohighlight
		(( $SYNC_CRONDAILY )) && YNC_CRONDAILY_TEXT='[On]'

```

The Sync Daily Menu Item thus always shows „Off“ even it was enabled.

---

<div class="post-metadata">

**Author:** ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)\
**Post date:** [24 December 2018 02:56 UTC](https://dietpi.com/forum/t/dietpi-sync-dry-run-option-not-working/2797/4 "2018-12-24T02:56:29Z")

</div>

WilburWalsh  
Thanks for testing.

Jep thanks, missing “S” 😮

---

<div class="post-metadata">

**Author:** ![WilburWalsh](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/w/c77e96/32.png) [@WilburWalsh](https://dietpi.com/forum/u/WilburWalsh)\
**Post date:** [24 December 2018 09:24 UTC](https://dietpi.com/forum/t/dietpi-sync-dry-run-option-not-working/2797/5 "2018-12-24T09:24:26Z")

</div>

Hi MichaIng ,

I‘m afraid there is another problem. Just checked whether the daily sync worked, and it did not 🤔  
The dietpi cron.daily script checks line 5 of the dietpi-sync\_settings file, but after removing the compression flag from it, there are only 4 lines left in that file, so that check fails.

Anyway, enjoy your holidays, I will be enjoying mine 🙂 and probably not be able to test the next couple of days.

---

<div class="post-metadata">

**Author:** ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)\
**Post date:** [25 December 2018 02:32 UTC](https://dietpi.com/forum/t/dietpi-sync-dry-run-option-not-working/2797/6 "2018-12-25T02:32:59Z")

</div>

Jep, just patched all other occurrences within code: [https://github.com/Fourdee/DietPi/pull/2366/files#diff-cb5f5ed4cb1765dffd7825148d853492](https://github.com/Fourdee/DietPi/pull/2366/files#diff-cb5f5ed4cb1765dffd7825148d853492)
