HowTo: GUI disk buffer flusher

Moderator: Forum moderators

Post Reply
User avatar
Jafadmin
Posts: 376
Joined: Tue Aug 04, 2020 4:51 pm
Has thanked: 68 times
Been thanked: 84 times

HowTo: GUI disk buffer flusher

Post 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 75 times
User avatar
greengeek
Posts: 1200
Joined: Thu Jul 16, 2020 11:06 pm
Has thanked: 340 times
Been thanked: 145 times

Re: HowTo: GUI disk buffer flusher

Post 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?
User avatar
Jafadmin
Posts: 376
Joined: Tue Aug 04, 2020 4:51 pm
Has thanked: 68 times
Been thanked: 84 times

Re: HowTo: GUI disk buffer flusher

Post 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.
Post Reply

Return to “Graphics/Video”