Quantcast
Channel: Debian User Forums
Viewing all articles
Browse latest Browse all 2901

Off-Topic • Re: [Software] cps - a useful addition to the cp command?

$
0
0
Compared it with rsync meself as well - consumes as "much" resources as rsync does (1% processor usage (Ryzen 7 5700G), 2,5MB of RAM used), performance is similiar to that of rsync. Both tested by copying ~50GB worth of data between two disks - both had LUKS-encrypted ext4 filesystem, the first being a 1TB HDD and the second - a 256GB NVMe SSD. Both programs set to preserve modification and access times

I think it's gonna be nice replacement for rsync in local (non-network) backups - Mainly because of it's simplicity, lack of networking overhead and interesting new options

I've noticed a problem with it, though - I'm somewhat bad at describing, so I'll give ye what I did instead:

Code:

pl@ambassador:~/Desktop/cps-1.1.2/src$ ls -l ~/Desktop/temptotal 4-rw-r--r-- 1 pl pl 1 Jan 20 22:30 grzybpl@ambassador:~/Desktop/cps-1.1.2/src$ ls -l ~/Desktop/temp2total 4-rw-r--r-- 1 pl pl 1 Jan 20 22:30 grzyb
temp is the first directory, temp2 is that second. Both have "same" file but of different contents (one from temp has "e" inside, the second - "a"). The first one was modified later than the second one

Code:

pl@ambassador:~/Desktop/cps-1.1.2/src$ ./cps ~/Desktop/temp/ ~/Desktop/temp2/Opening: /home/pl/Desktop/temp/home/pl/Desktop/temp/grzybOpening: /home/pl/Desktop/temp2/home/pl/Desktop/temp2/grzybDirectories to copy:directory: temp2 location: /home/pl/Desktop/temp2 new location: /home/pl/Desktop/temp2/temp2 size: 1SOURCE DIRECTORYNumber of files: 1Number of directories (excluding the top directory): 0Size of directory in bytes: 1DESTINATION DIRECTORYNumber of files: 1Number of directories (excluding the top directory): 0Size of directory in bytes: 1Number of individual files to copy: 1Size of individual files to copy in bytes: 0Number of directories to copy: 1Size of directories to copy in bytes: 1Files and directories to copy: Number of surplus files: 0Size of surplus files in bytes: 0Number of surplus directories: 0Size of surplus directories in bytes: 0Same files with different size (main location smaller): 0Same files with different size (main location larger): 0Same files with different modification time (main location newer): 0Same files with different modification time (main location older): 0Do you want to write the missing files and directories? Type yes or no ...yesDirectory: /home/pl/Desktop/temp2/temp2mkdir: Permission deniedread_write_data() 3: /home/pl/Desktop/temp2/temp2/temp2
After that, temp2 gets a non-accessible empty directory of the same name as itself:

Code:

pl@ambassador:~/Desktop/cps-1.1.2/src$ ls -l ~/Desktop/temp2total 8-rw-r--r-- 1 pl pl    1 Jan 20 22:30 grzybd--------- 2 pl pl 4096 Jan 20 22:38 temp2
It's a bug or did I miss something?

And also (not bugs):
- cps 1.1.2 declares itself as 1.1.1:

Code:

pl@ambassador:~/Desktop/cps-1.1.2/src$ ./cpsUsage: cps OPTIONS directory1 directory2       directory1 (the main directory)       directory2 (the secondary directory (directory that you wish to syncronize with the main directory).OPTIONS: (long option) or (short option) [...]cps 1.1.1
- Typo (?) in help:

Code:

       directory2 (the secondary directory (directory that you wish to syncronize with the main directory).
Shouldn't it be "synchronize"?

- It seems that default scans directories for different file sizes, comparing by modification time can be toggled by -T. I think it's better to have scan by modification time by default, and make scan by file size available by a option (for example, --scan-by-filesize). Why? File may be newer than the one on second dir, but may not be updated 'cause it's of the same size as the old one

Statistics: Posted by Hetzer — 2024-01-20 21:53



Viewing all articles
Browse latest Browse all 2901

Trending Articles