Code Monkey home page Code Monkey logo

Comments (9)

LarkinZero avatar LarkinZero commented on June 2, 2024 1

This is how Synology Technical Support responded to me.

Sorry, low-level commands are not supported by Synology nas, and we do not recommend you to do such operations on the low level, if you just want to move files, it is recommended to do it in the file station's ui, or you can use the shell's cp command if you must do it on the low level.
It is important to note that modifications to the base layer are a very dangerous operation, and if the modifications are too large, we will not be able to provide effective technical support and will only be able to reinstall the dsm system to restore normal use.

from cloudcmd.

coderaiser avatar coderaiser commented on June 2, 2024

It first tries to rename files and if error happened move files. Could you provide more details, or add some console.log to determine what kind of an error you have?

from cloudcmd.

LarkinZero avatar LarkinZero commented on June 2, 2024

I added some consoles in the moveFiles function and the removeAll function.
It took 6 seconds to move a 776MB file to another folder under the same partition.

test code

const moveFiles = require('@cloudcmd/move-files');
const wraptile = require('wraptile');

const move = moveFiles("/volume2/File/","/volume2/File1/",["proxmox-ve_6.1-1.iso"])
move.on('file', console.log)
    .on('error', console.log)
    .on('end', wraptile(console.log, 'done'));
console.log(new Date());

image

from cloudcmd.

LarkinZero avatar LarkinZero commented on June 2, 2024

/volume2/File is a shared directory for the Synology DSM.
/volume2/File1 is created by sudo mkdir /volume2/File1.
/volume2/File2 is created by sudo mkdir /volume2/File2.
This problem occurs when files in the directory /volume2/File are moved to /volume2/File1.
After I move the files in /volume2/File1 to /volume2/File2, the logs I added in moveFiles function are not generated.
image

from cloudcmd.

coderaiser avatar coderaiser commented on June 2, 2024

Let’s try to use @cloudcmd/rename-files directly, and take a look what error it produce.

from cloudcmd.

LarkinZero avatar LarkinZero commented on June 2, 2024

Let’s try to use @cloudcmd/rename-files directly, and take a look what error it produce.

EXDEV: cross-device link not permitted, rename '/volume2/File/proxmox-ve_6.1-1.iso' -> '/volume2/File1/proxmox-ve_6.1-1.iso'

test code

const renameFiles = require('@cloudcmd/rename-files');

const ok = () => 'ok';
const error = (e) => e.message;

renameFiles('/volume2/File/', '/volume2/File1/', ['proxmox-ve_6.1-1.iso'])
    .then(ok)
    .catch(error)
    .then(console.log);

from cloudcmd.

LarkinZero avatar LarkinZero commented on June 2, 2024

This looks like a problem with fs.rename

> fs.rename('/volume2/File/proxmox-ve_6.1-1.iso','/volume2/File1/proxmox-ve_6.1-1.iso',(err) => { if (err) throw err;  console.log('Rename complete!');})
undefined
> Uncaught:
[Error: EXDEV: cross-device link not permitted, rename '/volume2/File/proxmox-ve_6.1-1.iso' -> '/volume2/File1/proxmox-ve_6.1-1.iso'] {
  errno: -18,
  code: 'EXDEV',
  syscall: 'rename',
  path: '/volume2/File/proxmox-ve_6.1-1.iso',
  dest: '/volume2/File1/proxmox-ve_6.1-1.iso'
}

from cloudcmd.

coderaiser avatar coderaiser commented on June 2, 2024

Yes, you better create an issue in nodejs repo.
Looks like this file is a symlink or something…

from cloudcmd.

coderaiser avatar coderaiser commented on June 2, 2024

Looks like it’s related to Synology, and this is the place that should be fixed 🤷

from cloudcmd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.