[Solved] [not Bug] "Move and rename" action use copy instead of move

All your suggestions, requests and ideas for future development
Post Reply
1soproni
Posts: 4
Joined: 21 Sep 2016, 06:25

[Solved] [not Bug] "Move and rename" action use copy instead of move

Post by 1soproni »

Hi,

I use FileBot 4.7.2 on my Synology NAS.
As I see "move and rename" action is very slow because it uses "copy&rename then delete original" instead of "move&rename".

Example:
csaba@nas:~$ filebot -rename /volume1/video/Sorozatok/Igy.Jartam.Anyatokkal.S01-S05 -non-strict --db TheTVDB --format "{plex}" --action move --lang hu --output /volume1/homes/csaba/Sorozatok/
Rename episodes using [TheTVDB]
Auto-detected query: [Így jártam anyátokkal, how i met your mother]
Fetching episode data for [Így jártam anyátokkal]
[MOVE] Rename [/volume1/video/Sorozatok/Igy.Jartam.Anyatokkal.S01-S05/How.I.Met.Your.Mother.S01E01.avi] to [/volume1/homes/csaba/Sorozatok/TV Shows/Így jártam anyátokkal/Season 01/Így jártam anyátokkal - S01E01 - A kezdetek.avi]
[MOVE] Rename [/volume1/video/Sorozatok/Igy.Jartam.Anyatokkal.S01-S05/How.I.Met.Your.Mother.S01E02.avi] to [/volume1/homes/csaba/Sorozatok/TV Shows/Így jártam anyátokkal/Season 01/Így jártam anyátokkal - S01E02 - A lila zsiráf.avi]
[MOVE] Rename [/volume1/video/Sorozatok/Igy.Jartam.Anyatokkal.S01-S05/How.I.Met.Your.Mother.S01E03.avi] to [/volume1/homes/csaba/Sorozatok/TV Shows/Így jártam anyátokkal/Season 01/Így jártam anyátokkal - S01E03 - A szabadság édes íze.avi]
[MOVE] Rename [/volume1/video/Sorozatok/Igy.Jartam.Anyatokkal.S01-S05/How.I.Met.Your.Mother.S01E04.avi] to [/volume1/homes/csaba/Sorozatok/TV Shows/Így jártam anyátokkal/Season 01/Így jártam anyátokkal - S01E04 - Az ing visszatér.avi]
[MOVE] Rename [/volume1/video/Sorozatok/Igy.Jartam.Anyatokkal.S01-S05/How.I.Met.Your.Mother.S01E05.avi] to [/volume1/homes/csaba/Sorozatok/TV Shows/Így jártam anyátokkal/Season 01/Így jártam anyátokkal - S01E05 - Tök jó.avi]

On an another console in the same time:
csaba@nas:~$ ls -alh /volume1/homes/csaba/Sorozatok/TV\ Shows/Így\ jártam\ anyátokkal/Season\ 01/Így\ jártam\ anyátokkal\ -\ S01E05* /volume1/video/Sorozatok/Igy.Jartam.Anyatokkal.S01-S05/How.I.Met.Your.Mother.S01E05.avi
-rwxrwxrwx+ 1 csaba users 5.6M Sep 21 08:40 /volume1/homes/csaba/Sorozatok/TV Shows/Így jártam anyátokkal/Season 01/Így jártam anyátokkal - S01E05 - Tök jó.avi
-rwxrwxrwx+ 1 csaba users 207M Sep 18 21:38 /volume1/video/Sorozatok/Igy.Jartam.Anyatokkal.S01-S05/How.I.Met.Your.Mother.S01E05.avi

Move takes around 1-2 seconds but copy takes around 20 seconds per episodes:

Code: Select all

csaba@nas:/volume1/homes/csaba$ time cp /volume1/homes/csaba/Sorozatok/TV\ Shows/Így\ jártam\ anyátokkal/Season\ 01/Így\ jártam\ anyátokkal\ -\ S01E05\ -\ Tök\ jó.avi .

real    0m20.117s
user    0m0.006s
sys     0m0.360s
csaba@nas:/volume1/homes/csaba$ time mv Így\ jártam\ anyátokkal\ -\ S01E05\ -\ Tök\ jó.avi move_test.avi

real    0m1.188s
user    0m0.004s
sys     0m0.005s

Version info:
filebot -script 'fn:sysinfo'

------------------------------------------

FileBot 4.7.2 (r4178)
JNA Native: 4.0.1
MediaInfo: java.lang.UnsatisfiedLinkError: Unable to load library 'zen': Native library (linux-x86-64/libzen.so) not found in resource path ([file:/volume1/@appstore/filebot/FileBot.jar])
Apache Commons VFS: [zip, ftps, rar, ftp, sftp]
Chromaprint: java.io.IOException: Cannot run program "/usr/local/chromaprint/bin/fpcalc": error=2, No such file or directory
Extended Attributes: OK
Groovy Engine: 2.4.7
JRE: Java(TM) SE Runtime Environment 1.8.0_101 (headless)
JVM: 64-bit Java HotSpot(TM) 64-Bit Server VM
CPU/MEM: 2 Core / 614 MB Max Memory / 15 MB Used Memory
OS: Linux (amd64)
Package: SPK
Data: /volume1/@appstore/filebot/data/admin
uname: Linux nas 3.10.77 #8451 SMP Wed Aug 17 05:13:40 CST 2016 x86_64 GNU/Linux synology_braswell_416play
Done ヾ(@⌒ー⌒@)ノ

------------------------------------------

[Process completed]
Last edited by 1soproni on 28 Sep 2016, 15:46, edited 1 time in total.
User avatar
rednoah
The Source
Posts: 22991
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [Bug] "Move and rename" action use copy instead of move

Post by rednoah »

FileBot uses Java Files.move() which should be using the Posix move function internally. Hence, it should work, and if it doesn't then it can't be fixed in the FileBot code.


1.
Have you tried --action hardlink yet? Just to see what happens and to make sure it's on the same filesystem.


2.
Are you sure that the input and the output are on the same filesystem? Your mv command takes over 1 second which is 1000x longer than you'd expect from a mv call.

A 20x speed up of any mv/cp command could easily be explained if the file content is already in memory (e.g. if you call mv/cp twice in a row).

A 1000x slow down makes no sense at all (unless data on disk is physically copied).
:idea: Please read the FAQ and How to Request Help.
1soproni
Posts: 4
Joined: 21 Sep 2016, 06:25

Re: [Bug] "Move and rename" action use copy instead of move

Post by 1soproni »

1. I didn't try yet.

2. They were on the same filesystem. The mv test was slow because I tried until filebot also worked.
New tests with a 207M file:
mv:
real 0m0.011s
user 0m0.003s
sys 0m0.003s

cp:
real 0m4.197s
user 0m0.005s
sys 0m0.313s
1soproni
Posts: 4
Joined: 21 Sep 2016, 06:25

Re: [Bug] "Move and rename" action use copy instead of move

Post by 1soproni »

rednoah wrote:Have you tried --action hardlink yet? Just to see what happens and to make sure it's on the same filesystem.

Code: Select all

csaba@nas:~$ filebot -rename /volume1/video/Sorozatok/NCIS.S14E01.720p.HDTV.X264-DIMENSION/ -non-strict --db TheTVDB --format "{plex}" --action hardlink --lang hu --output /volume1/homes/csaba/Sorozatok/
Rename episodes using [TheTVDB]
Auto-detected query: [NCIS]
Fetching episode data for [NCIS]
Fetching episode data for [NCIS: Los Angeles]
Fetching episode data for [NCIS: New Orleans]
Auto-detected query: [NCIS]
Fetching episode data for [NCIS]
Fetching episode data for [NCIS: Los Angeles]
Fetching episode data for [NCIS: New Orleans]
[HARDLINK] Rename [/volume1/video/Sorozatok/NCIS.S14E01.720p.HDTV.X264-DIMENSION/NCIS.S14E01.720p.HDTV.X264-DIMENSION.hun.srt] to [/volume1/homes/csaba/Sorozatok/TV Shows/NCIS - Tengerészeti helyszínelők/Season 14/NCIS - Tengerészeti helyszínelők - S14E01 - Rogue.hun.srt]
[HARDLINK] Failed to rename [/volume1/video/Sorozatok/NCIS.S14E01.720p.HDTV.X264-DIMENSION/NCIS.S14E01.720p.HDTV.X264-DIMENSION.hun.srt]
Processed 0 files
/volume1/homes/csaba/Sorozatok/TV Shows/NCIS - Tengerészeti helyszínelők/Season 14/NCIS - Tengerészeti helyszínelők - S14E01 - Rogue.hun.srt -> /volume1/video/Sorozatok/NCIS.S14E01.720p.HDTV.X264-DIMENSION/NCIS.S14E01.720p.HDTV.X264-DIMENSION.hun.srt: Invalid cross-device link
java.nio.file.FileSystemException: /volume1/homes/csaba/Sorozatok/TV Shows/NCIS - Tengerészeti helyszínelők/Season 14/NCIS - Tengerészeti helyszínelők - S14E01 - Rogue.hun.srt -> /volume1/video/Sorozatok/NCIS.S14E01.720p.HDTV.X264-DIMENSION/NCIS.S14E01.720p.HDTV.X264-DIMENSION.hun.srt: Invalid cross-device link
	at net.filebot.util.FileUtilities.createHardLinkStructure(FileUtilities.java:139)
	at net.filebot.StandardRenameAction$5.rename(StandardRenameAction.java:76)
	at net.filebot.cli.CmdlineOperations.renameAll(CmdlineOperations.java:621)
	at net.filebot.cli.CmdlineOperations.renameSeries(CmdlineOperations.java:255)
	at net.filebot.cli.CmdlineOperations.rename(CmdlineOperations.java:110)
	at net.filebot.cli.ArgumentProcessor.runCommand(ArgumentProcessor.java:89)
	at net.filebot.cli.ArgumentProcessor.run(ArgumentProcessor.java:25)
	at net.filebot.Main.main(Main.java:124)
Failure (°_°)
User avatar
rednoah
The Source
Posts: 22991
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [Bug] "Move and rename" action use copy instead of move

Post by rednoah »

Code: Select all

Invalid cross-device link
The OS says that your source / destination paths are on two different filesystems, which means it's physically impossible do hardlink or move-without-copy operations.

You may use stat /path/to/folder to check what device/filesystem a given folder/file is on according to the OS.
:idea: Please read the FAQ and How to Request Help.
1soproni
Posts: 4
Joined: 21 Sep 2016, 06:25

Re: [Bug] "Move and rename" action use copy instead of move

Post by 1soproni »

Excuse me. You were right. They were on different filesystem. I assumed that everything is in the same filesystem below /volume1
I tested again, and it works well also with move action.
Thanks for your support.
Post Reply