LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 07-05-2008, 12:11 PM   #1
LemensTS
LQ Newbie
 
Registered: Jul 2008
Posts: 12

Rep: Reputation: 0
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!
 
Old 07-05-2008, 03:06 PM   #2
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,595
Blog Entries: 1

Rep: Reputation: 1046Reputation: 1046Reputation: 1046Reputation: 1046Reputation: 1046Reputation: 1046Reputation: 1046Reputation: 1046
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?
 
Old 07-05-2008, 03:42 PM   #3
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
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.

Last edited by stress_junkie; 07-05-2008 at 03:44 PM.
 
Old 07-07-2008, 12:30 AM   #4
LemensTS
LQ Newbie
 
Registered: Jul 2008
Posts: 12

Original Poster
Rep: Reputation: 0
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.
 
Old 07-07-2008, 05:37 PM   #5
LemensTS
LQ Newbie
 
Registered: Jul 2008
Posts: 12

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by stress_junkie View Post
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
 
Old 07-08-2008, 10:31 PM   #6
LemensTS
LQ Newbie
 
Registered: Jul 2008
Posts: 12

Original Poster
Rep: Reputation: 0
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...
 
Old 07-14-2008, 04:33 PM   #7
LemensTS
LQ Newbie
 
Registered: Jul 2008
Posts: 12

Original Poster
Rep: Reputation: 0
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....
 
Old 07-14-2008, 08:29 PM   #8
LemensTS
LQ Newbie
 
Registered: Jul 2008
Posts: 12

Original Poster
Rep: Reputation: 0
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...

Last edited by LemensTS; 07-14-2008 at 08:44 PM.
 
  


Reply

Tags
buffalo, nas, rsync, smbclient, smbfs


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Configuring a Buffalo NAS from the command line by calling the GUI des_a Linux - Networking 1 05-12-2008 09:34 PM
problem copying nfs folder of NAS jkeertir Linux - Hardware 0 03-25-2008 07:47 AM
remote NAS folder permissions after fresh install wawosz Linux - Newbie 2 10-01-2007 08:13 PM
Cron job to sync two directories Harimwakairi Programming 3 01-06-2006 12:25 AM
Hard Drive Install - Buffalo Linux esage Buffalo 13 05-30-2005 11:53 PM


All times are GMT -5. The time now is 01:34 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration