RichMiller
New Member
Hello,
I have very limited Linux experience but I have recently turned a raspberry pi into a home & office server (as i'm now working from home for the foreseeable). I feel a bit like the setup I have created is akin to Frankenstein's monster, but it seems to work. I have a series of USB3 external drives connected via a USB hub & a WD Mycloud drive heading into a small linksys switch, along with the pi and PCs.
I am currently trying to figure out a way to backup files from the WD Mycloud onto one of the USB3 drives, I have followed a tutorial on Medium to create a (I am learning as I go here) script as follows; (this is saved into my home/pi folder
#!/bin/bash #typically the first line of the bash scripts
BACKUPTIME=`date +%b-%d-%y` #get the current date
DESTINATION=/mnt/sdd1/PROJECTS ARCHIVE/Test Move To-$BACKUPTIME.tar.gz #create a backup file using the current date in it's name
SOURCEFOLDER=afp://Jupiter.local/Public on Jupiter/Caravan/001 Caravan Projects/Test Move From #the folder that contains the files that we want to backup
tar -cpzf $DESTINATION $SOURCEFOLDER #create the backup
I have used sudo crontab -e in the terminal to create what I hope is a scheduled event, this is the line of text I entered at the bottom of the nano terminal
15 12 * * * /bin/bash /home/pi/backup_script.sh
As you can assume, it's not working! I'm wondering if it has something to do with the pi stumbling with permissions from WD Mycloud, but that's only a very very uneducated hunch, just because the Mycloud is not a simple USB drive, it's attached via an ethernet cable directly into the switch.
I'd be hugely grateful for anyone to sacrifice the time to read this and if possible to lend some advice.
Many thanks
Rich
As a note - my intention is to have the projects folder backed up every night (essentially the same operation as windows copying all files over and choosing 'no' to overwriting).
I have very limited Linux experience but I have recently turned a raspberry pi into a home & office server (as i'm now working from home for the foreseeable). I feel a bit like the setup I have created is akin to Frankenstein's monster, but it seems to work. I have a series of USB3 external drives connected via a USB hub & a WD Mycloud drive heading into a small linksys switch, along with the pi and PCs.
I am currently trying to figure out a way to backup files from the WD Mycloud onto one of the USB3 drives, I have followed a tutorial on Medium to create a (I am learning as I go here) script as follows; (this is saved into my home/pi folder
#!/bin/bash #typically the first line of the bash scripts
BACKUPTIME=`date +%b-%d-%y` #get the current date
DESTINATION=/mnt/sdd1/PROJECTS ARCHIVE/Test Move To-$BACKUPTIME.tar.gz #create a backup file using the current date in it's name
SOURCEFOLDER=afp://Jupiter.local/Public on Jupiter/Caravan/001 Caravan Projects/Test Move From #the folder that contains the files that we want to backup
tar -cpzf $DESTINATION $SOURCEFOLDER #create the backup
I have used sudo crontab -e in the terminal to create what I hope is a scheduled event, this is the line of text I entered at the bottom of the nano terminal
15 12 * * * /bin/bash /home/pi/backup_script.sh
As you can assume, it's not working! I'm wondering if it has something to do with the pi stumbling with permissions from WD Mycloud, but that's only a very very uneducated hunch, just because the Mycloud is not a simple USB drive, it's attached via an ethernet cable directly into the switch.
I'd be hugely grateful for anyone to sacrifice the time to read this and if possible to lend some advice.
Many thanks
Rich
As a note - my intention is to have the projects folder backed up every night (essentially the same operation as windows copying all files over and choosing 'no' to overwriting).
Last edited: