Hi all - Not sure how relevant this local backup script is with TrusNAS Core 12.0-U6.
I would like to implement a more automated backup for some rotating USB External HDDs to backup the DATA pool.
My objectives / Questions
1. Use the existing usb disks I have to backup a subset1 and subset2 of data from the DATA pool.
2. Rotate them weekly for offsite storage.
3. Use the 2x 3Tb Disks for Subset1 of DATA
4. Use the 2x 2Tb Disks for Subset2 of DATA
5. If possible, would like the ability to plug these disks directly into a Windows PC to access the data backups.
6. Can I modify any of the below (in my post) to the suit anything listed in this post?
https://forums.freenas.org/index.php?resources/how-to-backup-to-local-disks.26/
7. Any improvements or recommendations welcome.
8. Is there a package that can be installed in TrueNAS (Similar to HyperBackup in a SynologyNAS) that can perform the backups to external disks?
* My TrueNAS Implementation *
TrueNAS is setup with a single Pool - DATA of 4x6Tb (RAIDZ2) - provides a total of just over 10Tb of storage.
4.38 TiB is in use.
Breakdown as follows:
* My External Backup Disks *
2x 3Tb External USB3 SATA Disks
2x 2Tb External USB3 SATA Disks
I already have these disks - They are currently formatted as NTFS.
They can be formatted to another type if required.
*********************
** My Current Soln **
I have been mounting the external USB HDDs using the kldload fuse command from a terminal window,
then running a rsync command to copy the data from the relevant folders to the external disks.
It does work with mixed results and requires lots of manual intervention and checking.
It's not 100% successful and reliable.
I have tried a SHELL script and starting them in CRON JOBS in the GUI and have mixed results.
So I have to revert to running them manaully - NOT IDEAL from Terminal Window.
Some details WRT the current solution as follows...
******************************************
Plug in external USB3 HDD - NTFS Formatted
In Storage - Disks - Should show DA0 (Or similar) - once external USB Disk is connected.
Disk - DA0
-- In TrueNAS GUI --
Go to Disks - This will show the dev number - eg "da0"
Open a terminal session
gpart show -p /dev/da0
This command above will show the partition on the external disk to mount below.
The output shows : /dev/da0p1
**
From shell cmd prompt
kldload fuse
cd ..
cd /mnt
mkdir ntfs
Then follow below.
Then open shell prompt on TrueNAS
kldload fuse
ntfs-3g /dev/da0p1 /mnt/ntfs (Where da0 = disk number and p? = the partition to be mounted)
rsync -avhP /mnt/DATA /mnt/ntfs This is the rsync source and dest locations (Data copy)
umount /mnt/ntfs Disconnect disk and store offsite
THE BELOW APPEARS TO WORK WELL - When run manually from a terminal shell command
*************************************************************
# Backup Subset1 ** MEDIA DATA TO OFFSITE 3 Tb USB DISK **
# Subset1 approx 2.69 Tb (Should copy across to 3 Tb Disks)
cd ..
cd /
kldload fuse
cd mnt
mkdir ntfs
ntfs-3g /dev/da0p1 /mnt/ntfs
rsync -avhP --delete-before /mnt/DATA/PlexMedia/Movies /mnt/ntfs/DATA
rsync -avhP --delete-before /mnt/DATA/DATASTORE /mnt/ntfs/DATA
umount /mnt/ntfs
**************************************************************
# Backup Subset2 ** WORK DATA TO OFFSITE HP DISKS **
# Subset2 approx 1.66Tb (Should copy across to 2Tb Disks)
kldload fuse
cd ..
cd mnt
mkdir ntfs1
ntfs-3g /dev/da0s1 /mnt/ntfs1
rsync -avhP --delete-before /mnt/DATA/Scans /mnt/ntfs1/DATA
rsync -avhP --delete-before /mnt/DATA/DCS /mnt/ntfs1/DATA
rsync -avhP --delete-before /mnt/DATA/Shared /mnt/ntfs1/DATA
rsync -avhP --delete-before /mnt/DATA/FileCentre /mnt/ntfs1/DATA
rsync -avhP --delete-before /mnt/DATA/Software /mnt/ntfs1/DATA
rsync -avhP --delete-before /mnt/DATA/UserData /mnt/ntfs1/DATA
rsync -avhP --delete-before /mnt/DATA/VMs /mnt/ntfs1/DATA
rsync -avhP --delete-before /mnt/DATA/PlexMedia/Music /mnt/ntfs1/DATA
rsync -avhP --delete-before /mnt/DATA/PlexMedia/TV /mnt/ntfs1/DATA
rsync -avhP --delete-before /mnt/DATA/PlexMedia/Photos /mnt/ntfs1/DATA
rsync -avhP --delete-before /mnt/DATA/PlexMedia/Videos /mnt/ntfs1/DATA
umount /mnt/ntfs1
**************************************************************
Disconnect external disk.
Should be accessible from a Windows pc.
**************************************************************
**************************************************************