Yes, there is no copy/move file commands for CLI, only move over GUI can be done. For now only solution (without
fetch command copy hack) is that backup script creates files directly on mounted disk path without need for copy/move.
To copy file locally over SSH using
fetch command:
/tool/fetch url=sftp://127.0.0.1 user=<ROS_USER> upload=yes src-path=<copy_from_file_path> dst-path=<copy_to_file_path>
If you have password allowed SSH login
password=<ROS_USER_PASSWORD> can be added to
fetch command argument, but is not recommended, better to use key auth.
SSH local access setup
For key auth to work, private/public key pair needs to be exported into files:
/ip/ssh/export-host-key key-file-prefix=ssh_key
and imported for SSH ROS user which will be used in
fetch command:
/user/ssh-keys/import public-key-file=ssh_key_<ssh_alg>_pub.pem user=<ROS_USER> key-owner=local
/user/ssh-keys/private/import private-key-file=ssh_key_<ssh_alg>.pem user=<ROS_USER> key-owner=local
Depending on firewall rules, in my case I needed to accept loopback interface in input chain to be able to connect to local SSH:
/ip/firewall/filter add action=accept chain=input in-interface=lo
Also additional note: if there is IP restriction in
/ip/service for ssh, then bridge address can be used instead 127.0.0.1 in sftp
fetch url because localhost address cannot be added there.
In this case if file moving is needed, then file can be just deleted by
/file/remove <copy_from_file_path> after is successfully uploaded by
fetch command.