Sem descrição.
23/02/2024
Publico
We'll be using tmux so the command can still run once the terminal is closed. First of all access the TrueNAS shell via SSH or via
System Settings -> Shell
After accessing the shell run tmux so the tmux server is initialized.
To mover our files we will be using rsync.
First of all lets check what files are targeted with the flag --dry-run
sudo rsync -avhP --ignore-existing --remove-source-files /mnt/my/path1/ /mnt/my/path2/ --dry-run-avhP: These flags have the following meanings:
-a: Archive mode. This is a comprehensive option that preserves almost everything about the file, including permissions, ownerships, timestamps, etc.-v: Verbose output. It provides detailed information about the files being transferred.-h: Human-readable output. It displays file sizes in a human-readable format.-P: This is a combination of --partial and --progress flags. --partial keeps partially transferred files and resumes the transfer if interrupted, and --progress shows progress during transfer.--ignore-existing: This flag tells rsync to skip files that already exist in the destination directory.--remove-source-files: This flag removes the files from the source directory after they have been successfully transferred to the destination.Run the following command to actualy move your files
sudo rsync -avhP --ignore-existing --remove-source-files /mnt/my/path1/ /mnt/my/path2/If for some reason you got disconnected during the file move you can reatach to your temux session by running:
tmux aIf you want to attach to another session you can run
tmux lsTo see the list of sessions, it should return something like:
0: 1 windows (created Fri Feb 01 00:00:00 XXXX)
4: 1 windows (created Fri Feb 01 00:00:00 XXXX)Then you can attach the session with
tmux attach-session -t 4Where 4 is the session number.
You can find more info on tmux here