11-29-2014, 12:27 AM
(11-28-2014, 10:59 PM)xoft Wrote: sudo mkdir /mnt/backupDid you use a user from the windows machine was there a promt for password?
sudo mount -t cifs //smbhost/path/folder /mnt/backup -o user=UserName
Quote:ls /mnt/backupCould you see some files from windows machine?
Quote:touch /mnt/backup/mytest.txt
So far only the last part fails, the mounted share is writable only by root.
This will be solved by using the right user for the smb mount or running the backup script as root.
I think the smb mount should be done on reboot, so i will try to explain how to do that later.
Now next part, the scp connect. Try to use this script at the raspberry. It will connect and create a new folder and copy one file inside. Make sure the destination path is in the home folder of the user you are using
#!/bin/bash user="USER" host="example.com" port=22 dest="/path/of/create/newfolder" src="1234.567" touch 1234.567 ssh -p $port $user@$host "mkdir -p $dest" && scp -rp -P $port $src $user@$host:$dest exit
let me know if this works for you. actually, do you have some experience with linux?