V6.2 -- DietPi-Sync Behaving Differently?

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
midnightwatcher
Posts: 33
Joined: Mon Dec 26, 2016 6:54 am

V6.2 -- DietPi-Sync Behaving Differently?

Post by midnightwatcher » Wed Feb 21, 2018 6:35 am

I updated to DietPi 6.2 and attempted to run DietPi-Sync this evening in an SSH session, however DietPi-Sync appears to be stuck, or is it just no longer displaying what it's doing? I need to confirm what files are being copied when doing a manual sync. Is this no longer possible? All I'm seeing is something similar to this:

[ SUB1 ] DietPi-Sync > sync
[ ... ] DietPi-Sync | Running command: rsync -avP4 --delete --log-file=/var/log/dietpi-sync.log --exclude-from=/tmp/.dietpi-sync_exclude --include-from=/tmp/.dietpi-sync_include /mnt/Server_Media/ /mnt/Server_Backup/

User avatar
MichaIng
Legend
Posts: 210
Joined: Sat Nov 18, 2017 5:21 pm

Re: V6.2 -- DietPi-Sync Behaving Differently?

Post by MichaIng » Wed Feb 21, 2018 12:22 pm

Hi midnightwatcher,

jep we switched the rsync command into our error handled G_RUN_CMD. This means that there is no output on screen, just in case of an error you will see an error message, showing necessary information and the last lines of the commands output, that high likely are related to the error.

However, you can always review the verbose output of the last sync at /var/log/dietpi-sync.log, for dietpi-backup it's dietpi-backup.log.

Generally, if you see the moving dot in the front, this means a command is running within our error handled functions. The output from the actual command is redirected to /tmp/G_ERROR_HANDLER_COMMAND and can be always reviewed there, only showing up on screen, is an actual error occurred, in ready for github copy&paste way 8-). With this we also try to reduce (unnecessary?) terminal output, showing what is interesting and preserving an overview over what is going on (especially within long dietpi-software installations, we felt, this might be beneficial), but always enabling to review more details, if necessary. Feedback on how and where we solved this good/bad is welcome! Work on this is still in progress.

midnightwatcher
Posts: 33
Joined: Mon Dec 26, 2016 6:54 am

Re: V6.2 -- DietPi-Sync Behaving Differently?

Post by midnightwatcher » Wed Feb 21, 2018 6:28 pm

Thank you for the reply, Michalng. This feels like a step back, however. I prefer to do a dry run first, but even that no longer tells me what's going on and having to then navigate to a log file when doing a sync via SSH seems to be a bit of a hassle when compared to the old way. If we cannot revert back to a real-time verbose/output, is there a way we can easily view the DietPi-Sync log file from within DietPi-Sync itself? If not, can that option be added?

User avatar
Fourdee
Site Admin
Posts: 2744
Joined: Tue Feb 06, 2007 12:36 pm

Re: V6.2 -- DietPi-Sync Behaving Differently?

Post by Fourdee » Wed Feb 21, 2018 7:33 pm

midnightwatcher wrote:Thank you for the reply, Michalng. This feels like a step back, however. I prefer to do a dry run first, but even that no longer tells me what's going on and having to then navigate to a log file when doing a sync via SSH seems to be a bit of a hassle when compared to the old way.
Thanks for the feedback.

I'll review this, see if we can improve.

EDIT: MichaIng has already covered most of this, but I had a quick look.

Ok, so currently, only the end result is shown (with status of success of failure). We essentially wanted to reduce the onscreen print during dietpi-backup and dietpi-sync, and, allow our global error system to handle errors more efficiently.

Code: Select all

			#Sync
			G_RUN_CMD rsync $rync_options --log-file=$LOGFILE --exclude-from="$FP_EXCLUDE_GLOBAL" --include-from="$FP_INCLUDE_GLOBAL" "$FP_SOURCE"/ "$FP_TARGET"/
			echo -e "Sync completed: $(date +"%d-%m-%Y_%H%M")" >> "$FP_TARGET/$SYNC_STATS_FILENAME"

			#Menu
			if (( $G_USER_INPUTS )); then

				if (( $SYNC_DRY_RUN == 0 )); then

					whiptail --title "Sync completed" --msgbox "$FP_SOURCE\n\nHas been synced to:\n$FP_TARGET\n\nLog file: $LOGFILE" --backtitle "$WHIP_BACKTITLE" 13 60

				else

					whiptail --title "Dry Run Sync completed" --msgbox "$FP_SOURCE\n\nHas been synced with a Dry Run (NO modifications) to:\n$FP_TARGET\n\nLog file: $LOGFILE" --backtitle "$WHIP_BACKTITLE" 13 60

				fi

			fi
The menus after command is completed, also mentions the logfile location /var/log/dietpi-sync.log, which contains verbose rsync operation, if required by end user.
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal and Bitcoin.

User avatar
Fourdee
Site Admin
Posts: 2744
Joined: Tue Feb 06, 2007 12:36 pm

Re: V6.2 -- DietPi-Sync Behaving Differently?

Post by Fourdee » Wed Feb 21, 2018 7:48 pm

@MichaIng

Maybe a solution here is we could implement:

Code: Select all

G_WHIP_VIEWLOG /log/file.log
And have a prompt inside the global to ask user if they would like to view the logfile, then display it?

I'll take a crack at this one :D

https://github.com/Fourdee/DietPi/issues/1546
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal and Bitcoin.

midnightwatcher
Posts: 33
Joined: Mon Dec 26, 2016 6:54 am

Re: V6.2 -- DietPi-Sync Behaving Differently?

Post by midnightwatcher » Wed Feb 21, 2018 9:38 pm

Thank you, Fourdee, that would be a reasonable compromise. Would this also prompt the user to view the log after a dry run?

User avatar
Fourdee
Site Admin
Posts: 2744
Joined: Tue Feb 06, 2007 12:36 pm

Re: V6.2 -- DietPi-Sync Behaving Differently?

Post by Fourdee » Wed Feb 21, 2018 9:50 pm

midnightwatcher wrote:Would this also prompt the user to view the log after a dry run?
Yep :)

Will make it for v6.3 update, we'll try to keep this update small, so we can aim release within 1 week.
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal and Bitcoin.

midnightwatcher
Posts: 33
Joined: Mon Dec 26, 2016 6:54 am

Re: V6.2 -- DietPi-Sync Behaving Differently?

Post by midnightwatcher » Thu Feb 22, 2018 8:10 am

Excellent. One final question - - Will there be a way to identify how many MB/s files are being copied/synced like the previous version?

User avatar
MichaIng
Legend
Posts: 210
Joined: Sat Nov 18, 2017 5:21 pm

Re: V6.2 -- DietPi-Sync Behaving Differently?

Post by MichaIng » Thu Feb 22, 2018 1:00 pm

Possible would be also to allow users setting verbose mode in sync/backup config. I guess most (at least me) don't need logs and that way we can skip whiptail question every time, which can be also not answered if run by cron job e.g.

I guess the size of transferred data is part of verbose rsync?

User avatar
Fourdee
Site Admin
Posts: 2744
Joined: Tue Feb 06, 2007 12:36 pm

Re: V6.2 -- DietPi-Sync Behaving Differently?

Post by Fourdee » Thu Feb 22, 2018 7:48 pm

MichaIng wrote:I guess the size of transferred data is part of verbose rsync?
Yep, contained at end of logfile.
Possible would be also to allow users setting verbose mode in sync/backup config. I guess most (at least me) don't need logs and that way we can skip whiptail question every time, which can be also not answered if run by cron job e.g.
Yep, good idea.
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal and Bitcoin.

Post Reply