LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Cron to sync folder to buffalo nas drive (http://www.linuxquestions.org/questions/linux-newbie-8/cron-to-sync-folder-to-buffalo-nas-drive-653750/)

LemensTS 07-05-2008 11:11 AM

Cron to sync folder to buffalo nas drive
 
Hello,

I have a buffalo nas drive, that i can access by:
smbclient -U //buffalo/share

Im not sure how i would go about having a folder:
/etc/files

sync to //buffalo/share/files



??
I figured rsync, but im confused on how to do it to a nas since i cant just say //buffalo/share in the rsync command

thanks!

sycamorex 07-05-2008 02:06 PM

I've been reading rsync man pages as I'd like to do a similar thing (to an ftp account on my NAS)
According to the man pages, however, rsync must be installed on both the source and destination machines,
which makes it impossible to use it with NAS, doesn't it?

stress_junkie 07-05-2008 02:42 PM

I've been playing with an Iomega NAS that runs Windows file sharing. Currently I mount the NAS share on a local mount point and then use rsync as if it were syncing two local directories.
Code:

mount -t smbfs -o username=whatever,password=whateverpass //192.168.1.4/public /mnt/iomega.public

rsync /home/whatever/music /mnt/iomega.public/music

I haven't got it working reliably yet. Some of the directories don't get copied to the NAS and I get weird errors about directories that don't exist. I wrote this FWIW. If it helps point anyone in a good direction then maybe we can figure this out together in this thread.

LemensTS 07-06-2008 11:30 PM

stress_junkie, that cmd works good, that is what i found in a tutorial also.

I got that working now.

Im gonna test it with rsync this week and see if i get missing files also, then i will report back.

LemensTS 07-07-2008 04:37 PM

Quote:

Originally Posted by stress_junkie (Post 3205007)
I've been playing with an Iomega NAS that runs Windows file sharing. Currently I mount the NAS share on a local mount point and then use rsync as if it were syncing two local directories.
Code:

mount -t smbfs -o username=whatever,password=whateverpass //192.168.1.4/public /mnt/iomega.public

rsync /home/whatever/music /mnt/iomega.public/music

I haven't got it working reliably yet. Some of the directories don't get copied to the NAS and I get weird errors about directories that don't exist. I wrote this FWIW. If it helps point anyone in a good direction then maybe we can figure this out together in this thread.

You may check that the file names do not have spaces in them. if they do thier is some extra cmd line things you need to add to the rsync statement, i got it wrote down somewhere ill post them when i find them.

i cant get:
rsync /test /mnt/buffalo/test

to work, keeps sayin:
skipping directory /test

not sure why yet

LemensTS 07-08-2008 09:31 PM

rsync -avz /test/* /mnt/buffalo/test

Using that command I got it to copy some files finally.

(1)
rsync: chown "/mnt/buffalo/test/nagios/module" failed: Operation not permitted (1)
rsync: chown "/mnt/buffalo/test/nagios/sample-config" failed: Operation not permitted (1)
rsync: chown "/mnt/buffalo/test/nagios/sample-config/template-object" failed: Operation not permitted (1)
rsync: chown "/mnt/buffalo/test/nagios/xdata" failed: Operation not permitted (1)

sent 7417870 bytes received 12978 bytes 316206.30 bytes/sec
total size is 19485183 speedup is 2.62
rsync error: some files could not be transferred (code 23) at main.c(977) [sender=2.6.9]


Now i have alot of files that did not copy, im not sure how to fix it....seems like it is trying to chown the files/folders on the buffalo but does not have permission...I have permission to mkdir but not to chown...

hmmm maybe im not using the admin account on the buffalo, ill look at it tomorrow and post back later...i imagine that is the problem...

LemensTS 07-14-2008 03:33 PM

mount -t smbfs -o username=root //my250gig/share /mnt/buffalo
Password:
16799: session setup failed: ERRSRV - ERRbadpw (Bad password - name/password pair in a Tree Connect or Session Setup are invalid.)
SMB connection failed

I set the admin password on my buffalo in the web admin, and this is what happens when i try to mount it using it.
If i dont put a password in it will work fine, but when running rsync or rsnapshot it will give me chown messages....

LemensTS 07-14-2008 07:29 PM

got some different messages

My super user is root of course in debian, but i had to create matthew user also when i installed it.

my super user on the buffalo is also root.
I went into the buffalo and made a user "matthew"

Then i went back in the debian and did:
mount -t smbfs -o username=matthew //192.168.6.112/share /mnt/linkstation

it asked for my password and I put in my matthew password that i use in debian.
And i see with ls -l root is owner now of the folders.

LTS ~ # rsnapshot daily
rsync: chown "/mnt/linkstation/snapshots/daily.0/localhost/test/nagios" failed: Operation not permitted (1)

but im still getting the chown error...errr...


looks like if the source file was user 501 and group 501, it sets the user and group on the buffalo to root instead... i think thats what the problem is, it cant set the permissions like it is on the linux system so it sets it all to root. It looks like all the files are in the backup...


All times are GMT -5. The time now is 11:48 PM.