January 16, 201313 yr Hi. I'm trying to find a way to dump the contents from a portable USB drive onto my UnRAID system. As I understand it, the best way is to use SNAP. Now I've got snap installed, but I'm unsure what to do next. How do I move the contents from the connected drive to the array? I've gotten to the point where a sharename is assigned to the connected device. I cannot see the device when browsing over the network. Clearly I'm missing something. Sorry about the noob question.
January 27, 201412 yr Hi. I would just like to add to this request. SNAP seems like a great tool and i have installed it but how to use it is not so clear to us none linux people. where would i find, or could someone create a guide? 1. How to installl (i have done this based on the info in the forums no problem) 2. How to assign a name to a disk 3. How to assigne a task or script to a drive when it is plugged in 4. How to assign several tasks to the same disk i.e. when disk "backups" is plugged in backup anything new in share / photos/family. Then backup contents of flash to /flashbackup. Then backup contents of /documents/Fred etc. Just how would this look - i see people doing one task but no mention of how to do several activities onto a single disk I am sure several of us would like to make use of this good tool for making backups to store off site on old HDD's hanging aound so some help clarifying things would be appreciated. Until then i will keep searching for snipets of info Thanks EDIT: OK so assigning the name to the disk i now have, you just follow the instructions at the bottom of the screen in Dynamix !! so double click the row with your drive in it, edit the name and press enter to save. You can then right click the row and mount the drive etc. So far so good. Now for the interesting bit, how do i do my lines 3 and 4 above?
January 27, 201412 yr Read the "Hot Plug Operation" in this post: http://lime-technology.com/forum/index.php?topic=29519.msg264817#msg264817 It will give you some direction on how to set up the script to do your copies.
January 27, 201412 yr Thanks for the link, i have been reading this and other parts and i am including the code i have come up with so far - which does not work. i am sure it has lots of errors in it but i dont know where as i am new to doing any linux code. i think you can see i have taken some of the examples already in place and tried to modify them. What i am trying to do is that when i plug in disk "External_1" it copies the contents of my flash drive and makes an archive backup of 2 folders full of pictures. Is it right i try to check if 3 folders exist and if not they are created and then i say with 3 differetn lines what i want rsync to do? I get the error /boot/config/plugins/snap/hotPlugAfterShareEvent.sh: line 112: ` ;;' /boot/config/plugins/snap/hotPlugAfterShareEvent.sh: line 112: syntax error near unexpected token `;;' Running hotPlugAfterShareEvent.sh I would appreciate some help trying to get this sorted out case $SHARENAME in 'External_1') LOGFILE=/var/log/External_1 PROG_NAME=External_1 logger Started -t$PROG_NAME echo "Started" > $LOGFILE if [ ! -d /mnt/user/External_1/flash ] then mkdir /mnt/user/External_1/flash if [ ! -d /mnt/user/External_1/familypics ] then mkdir /mnt/user/External_1/familypics if [ ! -d /mnt/user/External_1/scoutpics ] then mkdir /mnt/user/External_1/scoutpics rsync -a -v -q --delete /boot/ $MOUNTPOINT/flash 2>&1 >> $LOGFILE rsync -r -a /mnt/user/Pictures_Backup/Family_Photos/ $MOUNTPOINT/familypics 2>&1 >> $LOGFILE rsync -r -a /mnt/user/Pictures_Backup/Scouts_photos/ $MOUNTPOINT/scoutpics 2>&1 >> $LOGFILE logger Log File - External_1 -t$PROG_NAME /boot/config/plugins/snap/snap.sh -MW External_1 logger USB Flash Drive can be removed -t$PROG_NAME echo "USB Flash Drive can be removed" >> $LOGFILE ;; esac
January 27, 201412 yr Thanks for the link, i have been reading this and other parts and i am including the code i have come up with so far - which does not work. i am sure it has lots of errors in it but i dont know where as i am new to doing any linux code. i think you can see i have taken some of the examples already in place and tried to modify them. What i am trying to do is that when i plug in disk "External_1" it copies the contents of my flash drive and makes an archive backup of 2 folders full of pictures. Is it right i try to check if 3 folders exist and if not they are created and then i say with 3 differetn lines what i want rsync to do? I get the error /boot/config/plugins/snap/hotPlugAfterShareEvent.sh: line 112: ` ;;' /boot/config/plugins/snap/hotPlugAfterShareEvent.sh: line 112: syntax error near unexpected token `;;' Running hotPlugAfterShareEvent.sh I would appreciate some help trying to get this sorted out case $SHARENAME in 'External_1') LOGFILE=/var/log/External_1 PROG_NAME=External_1 logger Started -t$PROG_NAME echo "Started" > $LOGFILE if [ ! -d /mnt/user/External_1/flash ] then mkdir /mnt/user/External_1/flash if [ ! -d /mnt/user/External_1/familypics ] then mkdir /mnt/user/External_1/familypics if [ ! -d /mnt/user/External_1/scoutpics ] then mkdir /mnt/user/External_1/scoutpics rsync -a -v -q --delete /boot/ $MOUNTPOINT/flash 2>&1 >> $LOGFILE rsync -r -a /mnt/user/Pictures_Backup/Family_Photos/ $MOUNTPOINT/familypics 2>&1 >> $LOGFILE rsync -r -a /mnt/user/Pictures_Backup/Scouts_photos/ $MOUNTPOINT/scoutpics 2>&1 >> $LOGFILE logger Log File - External_1 -t$PROG_NAME /boot/config/plugins/snap/snap.sh -MW External_1 logger USB Flash Drive can be removed -t$PROG_NAME echo "USB Flash Drive can be removed" >> $LOGFILE ;; esac It's cleaner to use $MOUNTPOINT for all references to the drive. e.g. if [ ! -d $MOUNTPOINT/flash ] then mkdir $MOUNTPOINT/flash I'm not a Linux script guru, but I think this should be the proper syntax: ;; esac I'm don't think Linux likes white space before the two semi-colons. If you still have the error, comment out all the lines in the case statement and then fix the syntax error if it still occurs. If it doesn't, then uncomment pieces at a time and find which line is causing the error.
January 27, 201412 yr I installed Control panel plugin. This gives you a way thru unRaid Web GUI to install the plugins such as SNAP. Here is a snap shot of Once install you can drill in and see the pot of gold. This is a fraction of bling availible. Here is a snap shot of USB devices assigned and a old drive not mounted in the array. The GUI approach works best for me as I am a plug -n- play type of guy. Regards
January 28, 201412 yr Thanks for the input. I made some updates but i am still getting nothing working. Below is how the code looks now and also included is the original code supplied with the plugin refered to as "lexar" and also the code indicated in the link i was provided with (some differences in where the logfile goes etc i think) and the structure looks pretty close to me including the " ; part where i am getting a syntax error (without any beeps as my server has no means of making a noise). Also just a thought does it make any difference which way round the options go in rsync i.e. should -a be before -r or does that make no difference? The code does not seem do anything, there are no directories made etc so its almost like it is skipping everything and just going to the end. I have the plugin in dynamkix and i can see the drive is being mounted etc and the aftershareevent.sh code is being run - seems close but no cigar. Picture of the drive in snap is attached Any further inputs please, i am sure once its resolved i can use it as a model for more events on another drive i want to use (External_2) and also that others will be able to make use of a model where several events can take place when a drive is plugged in. Of course i could do all of this manually but where is the learning in that :-) case $SHARENAME in 'Lexar') beep -l 100 -f 2000 -n -l 150 -f 3000 beep -l 100 -f 2000 -n -l 150 -f 3000 if [ ! -d /mnt/user/Backup/Lexar ] then mkdir /mnt/user/Backup/Lexar fi cp -r $MOUNTPOINT/* /mnt/user/Backup/Lexar 2>&1 >> $SNAPLOGDIRECTORY/hotPlugAfterShareEvent.log beep -l 100 -f 2000 -n -l 150 -f 3000 beep -l 100 -f 2000 -n -l 150 -f 3000 beep -r 5 -l 100 -f 2000 ;; esac case $SHARENAME in 'External_1') LOGFILE=/var/log/External_1 PROG_NAME=External_1 logger Started -t$PROG_NAME echo "Started" > $LOGFILE if [ ! -d $MOUNTPOINT/flash ] then mkdir $MOUNTPOINT/flash if [ ! -d $MOUNTPOINT/familypics ] then mkdir $MOUNTPOINT/familypics if [ ! -d $MOUNTPOINT/scoutpics ] then mkdir $MO0UNTPOINT/scoutpics fi rsync -a -v -q --delete /boot/ $MOUNTPOINT/flash 2>&1 >> $LOGFILE rsync -r -a /mnt/user/Pictures_Backup/Family_Photos/ $MOUNTPOINT/familypics 2>&1 >> $LOGFILE rsync -r -a /mnt/user/Pictures_Backup/Scouts_photos/ $MOUNTPOINT/scoutpics 2>&1 >> $LOGFILE logger Log File - External_1 -t$PROG_NAME /boot/config/plugins/snap/snap.sh -MW External_1 logger USB Flash Drive can be removed -t$PROG_NAME echo "USB Flash Drive can be removed" >> $LOGFILE ;; esac Any help is much appreciated
January 28, 201412 yr Thanks for the input. I made some updates but i am still getting nothing working. Below is how the code looks now and also included is the original code supplied with the plugin refered to as "lexar" and also the code indicated in the link i was provided with (some differences in where the logfile goes etc i think) and the structure looks pretty close to me including the " ; part where i am getting a syntax error (without any beeps as my server has no means of making a noise). Also just a thought does it make any difference which way round the options go in rsync i.e. should -a be before -r or does that make no difference? The code does not seem do anything, there are no directories made etc so its almost like it is skipping everything and just going to the end. I have the plugin in dynamkix and i can see the drive is being mounted etc and the aftershareevent.sh code is being run - seems close but no cigar. Picture of the drive in snap is attached Any further inputs please, i am sure once its resolved i can use it as a model for more events on another drive i want to use (External_2) and also that others will be able to make use of a model where several events can take place when a drive is plugged in. Of course i could do all of this manually but where is the learning in that :-) case $SHARENAME in 'Lexar') beep -l 100 -f 2000 -n -l 150 -f 3000 beep -l 100 -f 2000 -n -l 150 -f 3000 if [ ! -d /mnt/user/Backup/Lexar ] then mkdir /mnt/user/Backup/Lexar fi cp -r $MOUNTPOINT/* /mnt/user/Backup/Lexar 2>&1 >> $SNAPLOGDIRECTORY/hotPlugAfterShareEvent.log beep -l 100 -f 2000 -n -l 150 -f 3000 beep -l 100 -f 2000 -n -l 150 -f 3000 beep -r 5 -l 100 -f 2000 ;; esac case $SHARENAME in 'External_1') LOGFILE=/var/log/External_1 PROG_NAME=External_1 logger Started -t$PROG_NAME echo "Started" > $LOGFILE if [ ! -d $MOUNTPOINT/flash ] then mkdir $MOUNTPOINT/flash if [ ! -d $MOUNTPOINT/familypics ] then mkdir $MOUNTPOINT/familypics if [ ! -d $MOUNTPOINT/scoutpics ] then mkdir $MO0UNTPOINT/scoutpics fi rsync -a -v -q --delete /boot/ $MOUNTPOINT/flash 2>&1 >> $LOGFILE rsync -r -a /mnt/user/Pictures_Backup/Family_Photos/ $MOUNTPOINT/familypics 2>&1 >> $LOGFILE rsync -r -a /mnt/user/Pictures_Backup/Scouts_photos/ $MOUNTPOINT/scoutpics 2>&1 >> $LOGFILE logger Log File - External_1 -t$PROG_NAME /boot/config/plugins/snap/snap.sh -MW External_1 logger USB Flash Drive can be removed -t$PROG_NAME echo "USB Flash Drive can be removed" >> $LOGFILE ;; esac Any help is much appreciated Take smaller steps to get this working. Take the basic hotPlugAfterEvent.sh script and rename the "Lexar" to "External_1" and add logging lines that log the fact that the case "External_1" has been executed. Then hot plug the drive and see what is logged. i.e. 'External_1') logger External_1 hot plug event -t$PROG_NAME echo "External_1 hot plug event" >> $LOGFILE ;; esac If that works then add your other script lines in small pieces to get the complete script working. If that doesn't work, try a drive name without the underscore - i.e. External1.
January 28, 201412 yr You have External_1 mounted. Did you go putty to users/mnt/, from here you should see a "disk" anlon with all other mounted drives. From here will reside assigned name of External_1 which you named in SNAP. You can do the same in Windows. Go to your network and tunnel to "disk" not disk1 , disk2, etc. and you should see the same within disk/External_1. Now for External_2, did you right click on it and select mount/share? Regards
January 28, 201412 yr You have External_1 mounted. Did you go putty to users/mnt/, from here you should see a "disk" anlon with all other mounted drives. From here will reside assigned name of External_1 which you named in SNAP. You can do the same in Windows. Go to your network and tunnel to "disk" not disk1 , disk2, etc. and you should see the same within disk/External_1. Now for External_2, did you right click on it and select mount/share? Regards It is mounted because the 'M' icon is highlighted in SNAP.
January 28, 201412 yr I sued the GUI in Dynamix to name each of the drives i have and want to use. When i put them into the external dock they get mounted and shared without a problem. I have tried writing to them etc just to prove they work and all seems good, they are shared and available just like any other share so that part is working fine, its just the automation after its mounted that seems to be eluding me. When i first started i went to the events tab and selected some different options just to see what they did - is there a chance this has confused the issue with SANP now wanting to do several things with this drive? Would it clear these issues if i renamed them in SNAP or is there a way to check this. I tried to comment out everything in my script after the mkdir parts just to see if i could get the directories created and this also does not work and i ge tthe same syntax error near unexpected token fed back even though this last ;; is exactly the same as the original Lexar part? I will have a go at the Lexar code but did not really want to change this Has anyone else got code to do several events when a drive is plugged in - cannot think i am the only person who wants to do this with spare external drives Thanks for the input so far
January 28, 201412 yr I sued the GUI in Dynamix to name each of the drives i have and want to use. When i put them into the external dock they get mounted and shared without a problem. I have tried writing to them etc just to prove they work and all seems good, they are shared and available just like any other share so that part is working fine, its just the automation after its mounted that seems to be eluding me. When i first started i went to the events tab and selected some different options just to see what they did - is there a chance this has confused the issue with SANP now wanting to do several things with this drive? Would it clear these issues if i renamed them in SNAP or is there a way to check this. I tried to comment out everything in my script after the mkdir parts just to see if i could get the directories created and this also does not work and i ge tthe same syntax error near unexpected token fed back even though this last ;; is exactly the same as the original Lexar part? I will have a go at the Lexar code but did not really want to change this Has anyone else got code to do several events when a drive is plugged in - cannot think i am the only person who wants to do this with spare external drives Thanks for the input so far In looking at your code once more I see a syntax issue. if [ ! -d $MOUNTPOINT/flash ] then mkdir $MOUNTPOINT/flash should be if [ ! -d $MOUNTPOINT/flash ] then mkdir $MOUNTPOINT/flash fi the syntax for the if statement is: if [...] then fi The missing closing 'fi' causing your issues. Each 'if' statement must be closed with a 'fi'.
January 28, 201412 yr Thanks for the input - another big step closer :-) I renamed the drive External to eliminate any possible issue with underscores and added in the "fi" comments. I now get the following when i plug the drive in. HOTPLUG(M): usb-VB0250EA_VER_2AFBFFFFFFFF-0:0 External has been unmounted... HOTPLUG(S): usb-VB0250EA_VER_2AFBFFFFFFFF-0:0 Unsharing External rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1042) [sender=3.0.7] rsync: change_dir "/mnt/user/Pictures_Backup/Scouts_photos" failed: No such file or directory (2) rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1042) [sender=3.0.7] rsync: change_dir "/mnt/user/Pictures_Backup/Family_Photos" failed: No such file or directory (2) Running hotPlugAfterShareEvent.sh devtype: part HOTPLUG(s): usb-VB0250EA_VER_2AFBFFFFFFFF-0:0 Is it ok to add in additional empty lines to make it easier to read or for now is it better i do the minimum formatting so as to not make any more small errors ! Looks to me like the folders are not being created and so the rsync command cannot be completed - but i could be a mile off ! And the code looks like case $SHARENAME in 'External') LOGFILE=/var/log/External PROG_NAME=External logger Started -t$PROG_NAME echo "Started" > $LOGFILE if [ ! -d $MOUNTPOINT/flash ] then mkdir $MOUNTPOINT/flash fi if [ ! -d $MOUNTPOINT/familypics ] then mkdir $MOUNTPOINT/familypics fi if [ ! -d $MOUNTPOINT/scoutpics ] then mkdir $MO0UNTPOINT/scoutpics fi rsync -a -v -q /boot/ $MOUNTPOINT/flash 2>&1 >> $LOGFILE rsync -r -a /mnt/user/Pictures_Backup/Family_Photos/ $MOUNTPOINT/familypics 2>&1 >> $LOGFILE rsync -r -a /mnt/user/Pictures_Backup/Scouts_photos/ $MOUNTPOINT/scoutpics 2>&1 >> $LOGFILE logger Log File - External_1 -t$PROG_NAME /boot/config/plugins/snap/snap.sh -MW External logger USB Flash Drive can be removed -t$PROG_NAME echo "USB Flash Drive can be removed" >> $LOGFILE ;; esac
January 28, 201412 yr Blank lines for readability are fine. They will be ignored. rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1042) [sender=3.0.7] ntfs-3g driver does not handle extended file attributes. rsync: change_dir "/mnt/user/Pictures_Backup/Scouts_photos" failed: No such file or directory (2) Do a telnet session to your server and see if you can ls the directory. i.e. ls /mnt/user/Pictures_Backup/Scouts_photos Is it possibly Scouts_Photos? rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1042) [sender=3.0.7] ntfs-3g driver does not handle extended file attributes. rsync: change_dir "/mnt/user/Pictures_Backup/Family_Photos" failed: No such file or directory (2) Do a telnet session to your server and see if you can ls the directory. i.e. ls /mnt/user/Pictures_Backup/Family_Photos
January 28, 201412 yr I have double checked everything and made some changes, i had $MOO.... instead of $MOU.... before scoutpics ! i have also added in some breaks to make it easier for me to try to read. I see there are some differences to the original Lexar code in terms of logfile which comes from using snapcommon.sh in each script but do not see where the logfile goes to be the issue. I have also been into every directory i have tried to copy across in telnet and they are there, i have even doble checked upper and lower case as Scout_photos has lower case p and in Family_Photos its upper case (must take more care of case in windows as its a bugger in Linux !!) I also think i have found that my doc uses the same ID to the server regardless of which spare drive is plugged in - i did read about this issue somwhere. To overcome this i have deleted all entrie relating to my drives and recreated the link to "External" only. I have been in every log file and deleted all of the contents - trying to get back to a fresh start Attached is how i see the 2 directoris in MC and in windows network (could it be a space v underscore issue, dont know how that works between windows and linux. I have added in underscores as it did some odd things when i just left spaces !!) And yes i still get all the same errors !! HOTPLUG(M): usb-VB0250EA_VER_2AFBFFFFFFFF-0:0 External has been unmounted... HOTPLUG(S): usb-VB0250EA_VER_2AFBFFFFFFFF-0:0 Unsharing External rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1042) [sender=3.0.7] rsync: change_dir "/mnt/user/Pictures_Backup/Scouts_photos" failed: No such file or directory (2) rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1042) [sender=3.0.7] rsync: change_dir "/mnt/user/Pictures_Backup/Family_Photos" failed: No such file or directory (2) mkdir: cannot create directory `/scoutpics': File exists Running hotPlugAfterShareEvent.sh devtype: part HOTPLUG(s): usb-VB0250EA_VER_2AFBFFFFFFFF-0:0 Sharing External... HOTPLUG(m): usb-VB0250EA_VER_2AFBFFFFFFFF-0:0 Using: mount -o umask=111,dmask=000 -t ntfs-3g /dev/disk/by-id/usb-VB0250EA_VER_2AFBFFFFFFFF-0:0-part1 /mnt/disk/External driver: usb /dev/disk/by-id/usb-VB0250EA_VER_2AFBFFFFFFFF-0:0-part1 case $SHARENAME in 'External') LOGFILE=/var/log/External PROG_NAME=External logger Started -t$PROG_NAME echo "Started" > $LOGFILE if [ ! -d $MOUNTPOINT/flash ] then mkdir $MOUNTPOINT/flash fi if [ ! -d $MOUNTPOINT/familypics ] then mkdir $MOUNTPOINT/familypics fi if [ ! -d $MOUNTPOINT/scoutpics ] then mkdir $M0UNTPOINT/scoutpics fi rsync -a -v -q --delete /boot/ $MOUNTPOINT/flash 2>&1 >> $LOGFILE rsync -a -r --update /mnt/user/Pictures_Backup/Family_Photos/ $MOUNTPOINT/familypics 2>&1 >> $LOGFILE rsync -a -r --update /mnt/user/Pictures_Backup/Scouts_photos/ $MOUNTPOINT/scoutpics 2>&1 >> $LOGFILE logger Log File - External -t$PROG_NAME /boot/config/plugins/snap/snap.sh -MW External logger USB Flash Drive can be removed -t$PROG_NAME echo "USB Flash Drive can be removed" >> $LOGFILE ;; esac
January 28, 201412 yr I have double checked everything and made some changes, i had $MOO.... instead of $MOU.... before scoutpics ! i have also added in some breaks to make it easier for me to try to read. I see there are some differences to the original Lexar code in terms of logfile which comes from using snapcommon.sh in each script but do not see where the logfile goes to be the issue. I have also been into every directory i have tried to copy across in telnet and they are there, i have even doble checked upper and lower case as Scout_photos has lower case p and in Family_Photos its upper case (must take more care of case in windows as its a bugger in Linux !!) I also think i have found that my doc uses the same ID to the server regardless of which spare drive is plugged in - i did read about this issue somwhere. To overcome this i have deleted all entrie relating to my drives and recreated the link to "External" only. I have been in every log file and deleted all of the contents - trying to get back to a fresh start Attached is how i see the 2 directoris in MC and in windows network (could it be a space v underscore issue, dont know how that works between windows and linux. I have added in underscores as it did some odd things when i just left spaces !!) And yes i still get all the same errors !! HOTPLUG(M): usb-VB0250EA_VER_2AFBFFFFFFFF-0:0 External has been unmounted... HOTPLUG(S): usb-VB0250EA_VER_2AFBFFFFFFFF-0:0 Unsharing External rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1042) [sender=3.0.7] rsync: change_dir "/mnt/user/Pictures_Backup/Scouts_photos" failed: No such file or directory (2) rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1042) [sender=3.0.7] rsync: change_dir "/mnt/user/Pictures_Backup/Family_Photos" failed: No such file or directory (2) mkdir: cannot create directory `/scoutpics': File exists Running hotPlugAfterShareEvent.sh devtype: part HOTPLUG(s): usb-VB0250EA_VER_2AFBFFFFFFFF-0:0 Sharing External... HOTPLUG(m): usb-VB0250EA_VER_2AFBFFFFFFFF-0:0 Using: mount -o umask=111,dmask=000 -t ntfs-3g /dev/disk/by-id/usb-VB0250EA_VER_2AFBFFFFFFFF-0:0-part1 /mnt/disk/External driver: usb /dev/disk/by-id/usb-VB0250EA_VER_2AFBFFFFFFFF-0:0-part1 case $SHARENAME in 'External') LOGFILE=/var/log/External PROG_NAME=External logger Started -t$PROG_NAME echo "Started" > $LOGFILE if [ ! -d $MOUNTPOINT/flash ] then mkdir $MOUNTPOINT/flash fi if [ ! -d $MOUNTPOINT/familypics ] then mkdir $MOUNTPOINT/familypics fi if [ ! -d $MOUNTPOINT/scoutpics ] then mkdir $M0UNTPOINT/scoutpics fi rsync -a -v -q --delete /boot/ $MOUNTPOINT/flash 2>&1 >> $LOGFILE rsync -a -r --update /mnt/user/Pictures_Backup/Family_Photos/ $MOUNTPOINT/familypics 2>&1 >> $LOGFILE rsync -a -r --update /mnt/user/Pictures_Backup/Scouts_photos/ $MOUNTPOINT/scoutpics 2>&1 >> $LOGFILE logger Log File - External -t$PROG_NAME /boot/config/plugins/snap/snap.sh -MW External logger USB Flash Drive can be removed -t$PROG_NAME echo "USB Flash Drive can be removed" >> $LOGFILE ;; esac Make these changes: rsync -a -r --update /mnt/user/Pictures\ Backup/Family\ Photos/ $MOUNTPOINT/familypics 2>&1 >> $LOGFILE rsync -a -r --update /mnt/user/Pictures\ Backup/Scouts\ photos/ $MOUNTPOINT/scoutpics 2>&1 >> $LOGFILE The space characters must be preceeded with the '\' character.
January 29, 201412 yr dlandon - thanks a lot for the help so far and sticking with it. Learning this stuff on the fly makes your head hurt !! i am not a Linux person you might have gathered . I am not near my server today but will check out putting in the "\" to cater for the spaces as s oon as i can. I also just read you can put the whole path statement in quotation marks and that would work the same, is that easier possibly? The space thing i can understand, what is not so clear is why it gets to the rsync lines but the directories are not created if its gone past that part of the code or why the flash part does not work - but let me try and fix these bits and see what progress that brings I really must be careful with upper and lower case and with spaces - in windows when i am adding folders to shares etc i just do not think about it. I might also consider renaming all folders on both of my unRAID servers so they are all lower case and no spaces but i need to think about what that might mean to my archonis true image backups which are scheduled and how crashplan running on one of the servers might handle me going in and changing folder names, dont want to have to go through everything and have to start again with all of that, how my TV's log into the servers to see my media etc. Would be great if they just recognised a folder name change but doubt i would be that lucky. EDIT: The code below seems to work. This does a backup of my flash drive after first deleting the old files and folders and then does an archive backup of 2 large picture folders. I might change the logging folder as per the Lexar example but for now this works. will put this on my main server and use the same disk there to back up some additional folders. Thank you to dlandon for giving me the pointers i needed and the general help, learnt a lot the last few days case $SHARENAME in 'External') LOGFILE=/var/log/External PROG_NAME=External logger Started -t$PROG_NAME echo "Started" > $LOGFILE if [ ! -d $MOUNTPOINT/flash ] then mkdir $MOUNTPOINT/flash fi if [ ! -d $MOUNTPOINT/familypics ] then mkdir $MOUNTPOINT/familypics fi if [ ! -d $MOUNTPOINT/scoutpics ] then mkdir $M0UNTPOINT/scoutpics fi rsync -a -v -q --delete /boot/ $MOUNTPOINT/flash 2>&1 >> $LOGFILE rsync -a -r --update "/mnt/user/Pictures Backup/Family Photos/" $MOUNTPOINT/familypics 2>&1 >> $LOGFILE rsync -a -r --update "/mnt/user/Pictures Backup/Scouts photos/" $MOUNTPOINT/scoutpics 2>&1 >> $LOGFILE logger Log File - External -t$PROG_NAME /boot/config/plugins/snap/snap.sh -MW External logger USB Flash Drive can be removed -t$PROG_NAME echo "USB Flash Drive can be removed" >> $LOGFILE ;; esac
Archived
This topic is now archived and is closed to further replies.