Page 1 of 1

HowTo: GUI disk buffer flusher

Posted: Sat Sep 19, 2020 3:41 pm
by Jafadmin
This is a script that you can click with a mouse that will flush the disk I/O buffers with 'sync'
the 'yad' version:

Code: Select all

yad --info --height=100 --width=100 --center --title="Syncing" --text="$(printf "\n\tSyncing buffers to disk ..\t\n")" &
sleep 2
sync
killall yad
yad --info --height=100 --width=100  --timeout=10 --center --title="Syncing" --text="$(printf "\n\t   Sync complete!\t\n")"
The 'Xdialog' version:

Code: Select all

Xdialog --title "Syncing" --msgbox " Syncing buffers to disk .. " 10 40 &
sleep 2
sync
killall Xdialog
Xdialog --title "Syncing" --timeout 10 --msgbox "  Sync complete!  " 10 40 

Here is the script (yad version) with a useful icon you can set to it. Put it in /my-applications/bin, then drag to the desktop
SyncToy.tar.gz
(2.18 KiB) Downloaded 83 times

Re: HowTo: GUI disk buffer flusher

Posted: Sun Sep 20, 2020 8:56 pm
by greengeek
Whilst testing the yad pet i got from Mikewalsh i saw a speed difference between the gtk and yad versions and it looks as if the synctoy gz version posted here lacks the "sleep2" that is visible within the code postings for the gtk and yad versions. That must be why i saw a speed difference (when buffers were already empty).

Was the "sleep 2" originally there in the gtk version for any particular reason - when the original yad version did not have it?

Or is is better to be left in for both versions?

Re: HowTo: GUI disk buffer flusher

Posted: Sun Sep 20, 2020 10:00 pm
by Jafadmin
greengeek wrote: Sun Sep 20, 2020 8:56 pm Whilst testing the yad pet i got from Mikewalsh i saw a speed difference between the gtk and yad versions and it looks as if the synctoy gz version posted here lacks the "sleep2" that is visible within the code postings for the gtk and yad versions. That must be why i saw a speed difference (when buffers were already empty).

Was the "sleep 2" originally there in the gtk version for any particular reason - when the original yad version did not have it?

Or is is better to be left in for both versions?
Honestly, it's a "comfort" pause so the end user can see what is happening. It can safely be removed if desired.