Hello Unix and Linux Lovers!I have spent now about 2 days looking for a solution of my problem but couldn't find a fitting one; I like to back up files to any usb stick which is connected on a raspberry pi running raspbian.I write here things I know, so you see what is missing:Using rsync will be the best for my purpose, this should work;rsync -v /home/pi/data /mnt/usbI can add the Job in crontab;crontab -e0 0 * * * rsync -v /home/pi/data /mnt/usbThis will back up my data every day (the 5 first signs are for the time Settings: Minutes Hours Days Months DayOfTheWeek, then Comes the command or script which should be executed).I can manually Mount a USB Stick like this: sudo mount -t vfat /dev/sda1 /mnt/usbBut what is missing:How can I mount automatically every usb stick, which is plugged in, in the Directory /mnt/usb (or /mnt/usb1, /mnt/usb2 etc)?How can I use rsync to sync the data in every Folder path? Do I Need a Shell script with a Loop or can I use it like this: rsync -v /home/pi/data /mnt/usb*?Thanks in Advance for help,Kind Regards
Auto Mount and Backup on any usb sticks connected
backup;automounting
I was now able to do ituse the tutorial which Arkadiusz Drabczyk posted:     http://www.axllent.org/docs/view/auto-mounting-usb-storage/make a short script, which seeks for all Folders beginning with usbhd in the media folder and sync to them. Use -rtuv for Windows fat formats, they don't support POISX semantic. This all leads to this script:sudo find /media -maxdepth 1 -name usbhd* | awk '{    cmd = rsync -rtuv --exclude '\''.*'\'' /home/pi/test $0    system(cmd)}' > /dev/null 2>&1Add a line to crontab, that the script is called regularly. Call: crontab -eAdd line (calls script every hr):0 * * * * . /scriptpath/myscript.awkAnd thats it.