From f7dec8daae438c5a9a87e1b8ce6fd06e8a134920 Mon Sep 17 00:00:00 2001 From: Joey Hafner Date: Thu, 7 Apr 2022 10:40:25 -0700 Subject: [PATCH] Append notification to copy command --- nas/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nas/README.md b/nas/README.md index 15c78f1..ffeb4bd 100644 --- a/nas/README.md +++ b/nas/README.md @@ -96,7 +96,7 @@ Partition: ID-1: / size: 62.24 GiB used: 26.84 GiB (43.1%) fs: zfs logical: free ## Perform a large copy operation in the background 0. `cd ~` for consistent placement of `nohup.out` -1. Use `nohup cp -rv /mnt/[from_pool]/[from_dataset]/ /mnt/[to_pool]/[to_dataset]` (pay attention to trailing slashes) to run the copy in the background. This will persist closing the terminal and completely closing the SSH connection. +1. Use `nohup cp -rv /mnt/[from_pool]/[from_dataset]/ /mnt/[to_pool]/[to_dataset] && echo "" | mail -s "Copy /mnt/[from_pool]/[from_dataset]/ to /mnt/[to_pool/[to_dataset] complete" root` (pay attention to trailing slashes) to run the copy in the background and send an email when the copy is complete. This will persist closing the terminal and completely closing the SSH connection. 2. Use `cmdwatch du -h ~/nohup.out` to watch the size of the log file increase (to confirm it is still copying) 3. Use `tail -f ~/nohup.out` to follow the actual logs. The original command writes to this file in batches when it is in the background, so don't expect it to be as smooth as running the command in the foreground.