SkillAgentSearch skills...

Copyfsync

The utility to copy files (to USB sticks for example) with fsync

Install / Use

/learn @psemiletov/Copyfsync
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

copyfsync

program by Peter Semiletov

https://github.com/psemiletov/copyfsync

The utility to copy file with synchronize after each copying iteration. Good for copy large file to USB stick when copying is slow or stalled. Some people are happy with /etc/sysctl.conf or /etc/sysctl.d/99-sysctl.conf file:

vm.dirty_bytes=50331648
vm.dirty_background_bytes=16777216

But it does not work in my case. So I wrote a simple copying program that call fsync (actually, fflush and fdatasync) after each copying iteration. copyfsync copies data by portions with the buffer size (2 MB by default) and sync buffer after earch read/write iteration.

Usage:

copyfsync filename destnation_dir

or:

copyfsync buffer_size filename destnation_dir

Examples...

Copy movie.avi to /run/media/username/FLASHDRIVE/:

copyfsync movie.avi /run/media/username/FLASHDRIVE/

Copy movie.avi to /run/media/username/FLASHDRIVE with 4 MB buffer (default 2 MB):

copyfsync 4 movie.avi /run/media/username/FLASHDRIVE/

Buffer size can be set in kbytes using the "K" suffix. Set the 1000 kbytes buffer:

copyfsync 1000K movie.avi /run/media/username/FLASHDRIVE/

If you like this program you can donate via:

Paypal: peter.semiletov@gmail.com

BTC: 1PCo2zznEGMFJey4qFKGQ8CoFK2nzNnJJf

Related Skills

View on GitHub
GitHub Stars4
CategoryDevelopment
Updated1y ago
Forks0

Languages

C

Security Score

70/100

Audited on May 2, 2024

No findings