Page 1 of 1

Rox file manager copying large files (how to know when complete)

Posted: Thu Jun 27, 2024 1:24 am
by bigpup

Copying large files in Rox file manager, may appear complete when it is not.

This is an issue with very large files and slow media (older hard drives, USB drives, etc....)

Rox file manager does copying in a two step process.

1. The copy is first written to RAM.

2. From RAM then written to the target media.

Rox just shows the first step, and will appear to show copy is complete, but it is still doing the copy from RAM to the target media.

For USB drives.
If you remove a USB drive being copied to, before the copy has been completely written.
It can end up with a corrupted drive and a not completed copy.

How do you know copying is complete for a USB drive?

1. If drive has an activity light. Wait for the light to stop blinking.

2. Right click on the desktop drive icon, for the USB drive partition being copied to, and choose UN-mount.
It will refuse to UN-mount, until the copying is complete. (indicated by the mount symbol on the right top corner of the icon)
When it will UN-mount. (mount symbol is gone)
You know it is finished doing the copy.

This also applies to any drive partitions a copy is being written too.
If Rox is still writing to it.
It will not UN-mount until writing is completed.


Re: Rox file manager copying large files (how to know when complete)

Posted: Thu Jun 27, 2024 6:39 pm
by wizard

@bigpup

You might also try this copydone.sh script from this post:
viewtopic.php?p=124397#p124397

wizard

Here's a little script created with YAD and based on the suggestions by @williams2 ..

Start your copy, then run copydone.sh (just click it). You'll get a "In progress" message and then a "Copy complete" message.

copydone.sh.gz
Remove fake .gz from name to make it an executable file.
(457 Bytes) Downloaded 30 times

.
.


Re: Rox file manager copying large files (how to know when complete)

Posted: Thu Jun 27, 2024 8:51 pm
by Flash

rsync has options -P and -progress that look like they might do what you want.

I think it was Plinej who wrote a front end for rxync that he called copy-fast. I use it because it copies mp3 files from a directory in numerical order. Dragging and dropping in Rox will sometimes copy files out of numerical order, which causes problems in some mp3 players. But copy-fast doesn't give notice when the copy is complete. Perhaps it could be modified to do that.


Re: Rox file manager copying large files (how to know when complete)

Posted: Fri Jun 28, 2024 4:50 am
by bigpup

Thanks for the added posts about other things to help.

This is a How -to topic.

So please provide the how- to use what ever you post.

With exact info on how to do it.

Thanks!


Re: Rox file manager copying large files (how to know when complete)

Posted: Fri Jun 28, 2024 9:01 am
by greengeek

I think the easiest way is - after starting the rox copy - open a terminal and type :

sync

When it comes back with the normal terminal prompt you know rox has finished.
Otherwise - you have to assume the copy is till running!


Re: Rox file manager copying large files (how to know when complete)

Posted: Fri Jun 28, 2024 11:02 am
by Chelsea80

Hello All

Interesting thread, variety of choices.

Flash wrote: Thu Jun 27, 2024 8:51 pm

rsync has options -P and -progress that look like they might do what you want.

Further investigation gives this:

In rsync what does the -P option do?

Sources
askubuntu.com favicon
superuser.com favicon

Answer
The -P option in rsync is a shorthand that combines two other useful options:

--progress: This shows progress during transfer

--partial: This keeps partially transferred files

Specifically:

The --progress option displays detailed information about the transfer as it's happening. It shows you which files are being transferred and provides statistics on the transfer speed, percentage complete, and estimated time remaining

The --partial option allows rsync to keep partially transferred files if the transfer is interrupted. This is useful for resuming large file transfers that may have been stopped due to network issues or other interruptions

By using -P, you get both of these functionalities in a single, convenient option. This is particularly helpful when transferring large files or directories over potentially unreliable connections, as it allows you to monitor the progress and easily resume interrupted transfers. For example, a command using the -P option might look like this:

rsync -avzP source_directory/ user@remote_host:destination_directory/

This command would transfer files from source_directory to destination_directory on a remote host, showing progress during the transfer and allowing for partial transfers to be resumed if interrupted

Hope it helps.

EDIT

If you still interested in using rsync then the attached is a pretty good read. Scroll to the end to find info on USB.

rsync.pdf
(360.54 KiB) Downloaded 34 times

Re: Rox file manager copying large files (how to know when complete)

Posted: Sat Jun 29, 2024 7:24 pm
by HerrBert
bigpup wrote: Thu Jun 27, 2024 1:24 am

Copying large files in Rox file manager, may appear complete when it is not.

This is an issue with very large files and slow media (older hard drives, USB drives, etc....)

Rox file manager does copying in a two step process.

1. The copy is first written to RAM.

2. From RAM then written to the target media.

Rox just shows the first step, and will appear to show copy is complete, but it is still doing the copy from RAM to the target media.

For USB drives.
If you remove a USB drive being copied to, before the copy has been completely written.
It can end up with a corrupted drive and a not completed copy.

How do you know copying is complete for a USB drive?

1. If drive has an activity light. Wait for the light to stop blinking.

2. Right click on the desktop drive icon, for the USB drive partition being copied to, and choose UN-mount.
It will refuse to UN-mount, until the copying is complete. (indicated by the mount symbol on the right top corner of the icon)
When it will UN-mount. (mount symbol is gone)
You know it is finished doing the copy.

How about a notification when unmount completed?
What i did in all my slacko installs is to edit /usr/local/pup_event/frontend_rox_funcs to show a yaf-splash notification if rox has unmounted a usb drive.

I know that modern Puppies differ. So here is a piece of code i'm using in slacko:

Replaced line 576: [ "$DRV_CATEGORY" = "optical" ] && eject /dev/$ONEDRVNAME
with:

Code: Select all

			case $DRV_CATEGORY in
				optical) eject /dev/$ONEDRVNAME;;
				usbdrv) # HerrBert, kein NLS
					yaf-splash -close never -timeout 5 -placement bottom -text "$ONEDRVNAME kann jetzt entfernt werden" & ;;
			esac

Where yaf-splash is the traditional symlink to /usr/bin/gtkdialog-splash
With my modified /usr/lib/gtkdialog/box_splash it looks like this:

unmount-notification.gif
unmount-notification.gif (162.91 KiB) Viewed 1245 times

Re: Rox file manager copying large files (how to know when complete)

Posted: Sun Jun 30, 2024 12:06 am
by bigpup

Thanks for all the useful tips and edits!

However, the topic is about how to do it as Puppy is not modified, added to, or changed.

But I am sure we can all make use of the stuff in the other posts :thumbup: :D

Keep them coming, if you know of something else to do, to help with this issue :thumbup:


Re: Rox file manager copying large files (how to know when complete)

Posted: Sun Jun 30, 2024 12:23 am
by Flash

The copy command, cp, has an option, -v (for verbose).


Re: Rox file manager copying large files (how to know when complete)

Posted: Wed Jul 03, 2024 4:37 pm
by superhik

The problem arises due to buffering, where completion in RAM may signify finished writing, but data is still being written to the drive. This issue occurs consistently across various file managers. To monitor USB drive insertions and ongoing data writes, I've devised a script that reads from /sys/block. Ideally, this script should be displayed on the panel or integrated into Conky. When the script detects USB drive activity, it should indicate ongoing operations, and when idle, it should confirm no ongoing writes.

Code: Select all

#!/bin/bash
# while sleep 2; do
	if ls -l /dev/disk/by-path/*usb* &>/dev/null; then

		USB_DET=($(ls -l /dev/disk/by-path/*usb* | grep -v "part" | awk '{print $NF}' | awk -F "/" '{print $NF}' | sort))

		for usb in "${USB_DET[@]}"
		do
          	 	if [ $(awk "{ print \$9 }" /sys/block/$usb/stat) -gt 0 ]
			then
				sector_size=$(cat /sys/block/$usb/queue/hw_sector_size)

				DATA_WRITTEN=$(awk '{load = $7*sector/1000/1000
							printf "%.1f", load}'  sector="$sector_size" /sys/block/$usb/stat)
        			printf "%s: %s%s " "$usb" "$DATA_WRITTEN" "MiB"
			else
				printf "%s: %s " "$usb" "idle"
			fi
		done
	else
		echo "USB None"
	fi
# done