April 6, 201115 yr I just bought a NAIM HDX Network Music Player/Server and attached it to my network. Nice machine and great sound but it doesn't have any backup capabilities for the 800 CD's I ripped to it's internal 1TB disk. The HDX disk is visible in the network as R/O drive and my question is if unRAID is able to copy the whole HDX data drive to an unRaid share e.g. HDX Backup (daily or weekly at least)? I read through the forum but all I was able to find is the rsync solution which doesn't help as rsync can't be installed onto the HDX and I think that having rsync on both machines is a prerequisite?
April 6, 201115 yr If you can mount the drive locally on the unraid machine via CIFS or NFS than it's just a matter of scripting it. The script would look something like mkdir /mnt/tmp mount -t CIFS //HDX-device-name/sharename /mnt/tmp {copy} /mnt/tmp /mnt/User/HDXBackup umount /mnt/tmp rmdir /mnt/tmp That is very crude and would need a lot of work but it's something to get you started. For {copy} you could use the cp command or you could use rsync. rsync can copy from location to location. You could then run the script manually or fire it off periodically via cron.
April 6, 201115 yr I just bought a NAIM HDX Network Music Player/Server and attached it to my network. Nice machine and great sound but it doesn't have any backup capabilities for the 800 CD's I ripped to it's internal 1TB disk. The HDX disk is visible in the network as R/O drive and my question is if unRAID is able to copy the whole HDX data drive to an unRaid share e.g. HDX Backup (daily or weekly at least)? I read through the forum but all I was able to find is the rsync solution which doesn't help as rsync can't be installed onto the HDX and I think that having rsync on both machines is a prerequisite? It is not necessary to have rsync on both machines. The basic steps are to create a mount point for the music-player (an empty directory) mkdir -p /mnt/hdx Then mount the HDX share on the mount point mount -t cifs //HDX/share_name /mnt/hdx (where //HDX = the name the music player presents on the LAN and share_name the name of the shared directory) The above two steps need to be performed each time you reboot your unRAID server. Create a directory to hold the backup (to be done once) mkdir -p /mnt/disk1/HDX_Backup Then you can just run the rsync command once a day/week by adding a command to the unRAID cron schedule something like this: rsync -rlpgoDvrH /mnt/hdx/ /mnt/disk1/HDX_Backup
April 6, 201115 yr Author Thanks a lot Joe - will give it a try with my limited skills :-) My initial questions are: Can I just edit the cron schedule with crontab -e? Is there anything which will overwrite my changes later on? (e.g. unMENU is making changes, no?) Is there any reason you are using /mnt/disk1/HDX_Backup instead of /mnt/user/HDX_Backup? (This is a user share I already defined with the help of the web management console) As far as I understood rsync direction is going (in that case) from HDX --> unRAID Server? That means a deletion from the HDX will cause a deletion of that same file on the Server which is the expected outcome? root@Tower:~# crontab -l # Run hourly cron jobs at 47 minutes after the hour: 47 * * * * /usr/bin/run-parts /etc/cron.hourly 1> /dev/null # # Run daily cron jobs at 4:40 every day: 40 4 * * * /usr/bin/run-parts /etc/cron.daily 1> /dev/null # # Run weekly cron jobs at 4:30 on the first day of the week: 30 4 * * 0 /usr/bin/run-parts /etc/cron.weekly 1> /dev/null # # Run monthly cron jobs at 4:20 on the first day of the month: 20 4 1 * * /usr/bin/run-parts /etc/cron.monthly 1> /dev/null # shutdown server if disk temperatures get too high: */5 * * * * /usr/local/sbin/overtemp_shutdown.sh 1>/dev/null 2>&1 # check parity on the first of every month at midnight: 0 0 1 * * /root/mdcmd check NOCORRECT 1>/dev/null 2>&1 # Removing .DS_Store files 42 3 * * * find / -name ".DS_Store" -depth -exec rm "{}" ';'>/dev/null 2>&1 # Removing ._ files 42 3 * * * find / -name "._*" -depth -exec rm "{}" ';'>/dev/null 2>&1 # Removing .Spotlight-V100 folders 42 3 * * * find / -name ".Spotlight-V100" -depth -exec rm -r "{}" ';'>/dev/null 2>&1 # Removing .Trashes folders 42 3 * * * find / -name ".Trashes" -depth -exec rm -r "{}" ';'>/dev/null 2>&1 # Removing .fseventsd folders 42 3 * * * find / -name ".fseventsd" -depth -exec rm -r "{}" ';'>/dev/null 2>&1
April 6, 201115 yr Easiest way to cron on a daily basis is to just drop the script into: /etc/cron.daily/ It'll get executed every day according to the schedule set in crontab - 4:40am in your case (the default). Can do the same for hourly, weekly or monthly using cron.hourly, cron.weekly and cron.monthly, respectively.
April 6, 201115 yr These commands need to into a "copy" script on your flash drive. A line added to the go script will then call this copy script. This way it will survive reboots.
April 6, 201115 yr Thanks a lot Joe - will give it a try with my limited skills :-) My initial questions are: Can I just edit the cron schedule with crontab -e? Is there anything which will overwrite my changes later on? (e.g. unMENU is making changes, no?) A reboot would overwrite all. Better to use a script to edit crontab as needed and invoke the script upon reboot. Is there any reason you are using /mnt/disk1/HDX_Backup instead of /mnt/user/HDX_Backup? (This is a user share I already defined with the help of the web management console) Yes, 1. efficiency. 2. to keep it all on one disk. (you can put it on any one disk you like, since it will fit.) 3. rsync uses the modification times to track changes to the disks, not sure if they are accurately reflected in the user-share. As far as I understood rsync direction is going (in that case) from HDX --> unRAID Server? That means a deletion from the HDX will cause a deletion of that same file on the Server which is the expected outcome? The command I gave as an illustration does not remove files no longer on the source server. You would need to add that option to the rsync command if it is your desire. Yes, some unMENU packages add crontab entries. Clone one of the packages, rename it, and as long as you keep the basic pattern it is looking for in the name it will show up in the package manager. then, make it into the command you wish to invoke. unMENU will re-install on reboot for you if you elect. Joe L.
April 13, 201115 yr Author Joe, thanks a lot for your help. This is my updated GO script now, including the creation of the mount point and the mount of the HDX share at the very end of the file: #!/bin/bash # Start the Management Utility /usr/local/sbin/emhttp & # # unMENU echo "/boot/unmenu/uu" | at now + 1 minute # cd /boot/packages && find . -name '*.auto_install' -type f -print | sort -r | xargs -n1 sh -c sed -i "s/^short_open_tag = Off/short_open_tag = On/" /boot/custom/php/php.ini # #wait until all the configured disks are mounted num_configured=`grep "disk[0-9]*=" /boot/config/disk.cfg | wc -l` while sleep 5 do md_disk_mounted=`mount | grep "/dev/md[0-9]*" | wc -l` [ "$num_configured" = "$md_disk_mounted" ] && break done # # Set disk read-ahead 2048 for i in /dev/md* do blockdev --setra 2048 $i done # # cpufreq support modprobe speedstep-lib # # Increase network performance echo nameserver 192.168.178.1 >/etc/resolv.conf echo 192.168.178.28 tower >>/etc/hosts # # Powerbutton clean shutdown CTRLALTDEL=yes installpkg /boot/packages/powerdown-1.02-noarch-unRAID.tgz [ -f /sbin/powerdown ] && mv /usr/local/sbin/powerdown /usr/local/sbin/unraid_powerdown [ -f /sbin/powerdown ] && sed -i "sX/usr/local/sbin/powerdownX/sbin/powerdownX" /etc/acpi/acpi_handler.sh [ ! -f /usr/local/sbin/unraid_powerdown ] && sed -i "sX/sbin/init 0X/sbin/powerdownX" /etc/acpi/acpi_handler.sh sysctl -w kernel.poweroff_cmd=/sbin/powerdown # # Naim HDX Backup mkdir -p /mnt/user/HDX mount -t cifs //NSHDX03D5/music /mnt/user/HDX As I don't have a full 1TB disk available I wasn't able to take your advise using a disk instead of a user share. The script hdx_backup is now sitting in /etc/cron.daily: #!/bin/bash # Copy HDX Music Files to unRAID Server # echo "Backing up Naim HDX music library" rsync -rpgoDvrH --delete-after --ignore-existing /mnt/user/HDX/ /mnt/user/HDX_Backup The daily cron jobs are now running at 12:40 every day (according to the crontab -l output): 40 12 * * * /usr/bin/run-parts /etc/cron.daily 1> /dev/null A dry run of the script ran successful - only the new files were being copied. Do you have any more advise? Btw. at least these commands from my go script seems not to be being executed at reboot (since I have 5b6a installed): # Set disk read-ahead 2048 # Powerbutton clean shutdown (alt-ctrl-del is working but not the button of the tower)
April 14, 201115 yr rsync -rlpgoDvrH /mnt/hdx/ /mnt/disk1/HDX_Backup Is there an extra "r" flag ? I see it listed twice... or is the second "r" used for something ?
April 14, 201115 yr rsync -rlpgoDvrH /mnt/hdx/ /mnt/disk1/HDX_Backup Is there an extra "r" flag ? I see it listed twice... or is the second "r" used for something ? probably a typo.
Archived
This topic is now archived and is closed to further replies.