back up to NAS
Hey peeps, I spent all night trying to find a way to back up to NAS (ftp )from command line in linux(Redhat 4).I tried curl , but that is basically for one file transfers. I did the following for multiple files, but it didnt work
for f in /home/no/*; do curl --upload-file "$f" --ftp-pasv ftp://root:123456@44.44.44.44/backup; done I tried mput -R but didnt work Anyone have any ideas to do it best? Thank you |
any help or suggestion is good, i think i exhausted google.
|
If you provide more information about how the NAS is connected to you system, we can understand better what is possible and what not.
Right now, lacking information, I would recommend to mount the NAS on your file system, and run rsync, excluding /mnt, /proc, and sys. Much easier than ftp like solutions and you do incremental backups by default. jlinkels |
NAS , network attached storage, so its not connected to my system directly, its over the network , thats why I need to ftp in order to transfer the data.Sorry didnt state that.
|
NAS-es only accessible by FTP? I don't think so. For Windows machines I expect you can map drives on your Windows machines using SMB. Since many NAS-es run Linux internally usually you can mount these drives using NFS. This seems probable as FTP is also available. However if all else fails, you can install a SMB client on your machine and connect using Samba. Then the NAS has become part of you file system.
jlinkels |
Double post, sorry
|
What NAS is it? Brand, type etc..
|
ok @klinkels, thats a good idea I will try that, never heard of that been done before, thanks for the input.
@kellemes, its a DLINK DNS-321 . |
This is what jlinkels means, just mount the NAS like any other disk/partition you have on your system..
You may have to play with it a little to get it going on your system but this works for me.. This is on of my fstab-entries (/etc/fstab) for connecting to a Synology ds207+ Code:
//IP_TO_NAS/shared_folder /mnt/dir cifs user,uid=1000,rw,suid,credentials=/etc/credentials 0 0 Syntax: Code:
username=john (Don't know how to do that in RedHat) |
ooo ok, didnt know that was possible, I get you now jlinkels , sry didn't before.But I cant seem to install smbfs for red hat lol, cant find it thorough google, all the info I found says its being replaced by cifs.anyone knows how to?
|
mount -t cifs //volume_1 /media/smbnas -o port=21,ip=799.79.49.69,username=st90
it ask for pass, but then I get mount error(22): Invalid argument |
now I try :
mount -t cifs //76.73.48.66/volume_1 /media/smbnas -o port=21,ip=76.73.48.66,username=staiin,password=AAAAAAA I get this mount error 112 = Host is down , I think I get this because I am trying to access across a different network.Not sure any help please? |
First leave out the port=21. Port 21 is for FTP and that is not what you are doing here.
How do you mean the NAS is on a different network? Is it not part of your LAN? If not, ou should make sure there is a connection possible on port 445 and 137,138,139. If you are trying to access this over a public network I must discourage opening those ports though as it infers a security risk. If the NAS is on the other side of a public network I recommend that you find out if the box does run Linux and if SSH and NFS are supported. IN that cae you can open a SSH tunnel and perform NFS connection. In any way, NFS is to preferred over SMB and/or FTP as user permissions are handled correctly while they are not in SMB. jlinkels |
The manual does not indicate that the box supports any other protocols other then FTP and CIFS. If this unit is on a different network is it also behind a firewall/router?
|
Quote:
Well the box does support NFS and SMB, it has port 21 open , so I decided to use port 21.Which other port am I to open then if not 21? The box is in the same NOC , but on a different subnet/network.The box doesnt run SSH though only SMB and NFS. I dont think its behind a firewall, but can ask the NOC if it is(No firewall system is in place on the NAS) |
All times are GMT -5. The time now is 11:42 PM. |