Adam Turner
Sunday, 04 November 2007 20:06
Opinion and Analysis
Page 2 of 4
I kept trying to change the rights on particular folders, but I suspected the problem was with the way I was mounting the drive.
My troubleshooting was hampered by the fact that the mounted drive would regularly hang in the Nautilus file explorer, forcing me to reboot because I didn't know how else to deal with it. Using the IP address of the Maxtor network drive (192.168.0.3) rather than the name (hyperspace), improved things slightly.
On one reboot something went awry with gnome, it spurted out some kind of error. The Ubuntu appearance theme looked slightly different, but my network drive hanging problems were gone. Now that I had a suspect, I did a little digging and discovered if I disabled all the Nautilus file preview settings my problems went away. Even though they'd been set to "Local files only", I think they'd been treating the mounted network drive as a local drive and getting bogged down in trying to preview all those files.
With my stability issues resolved, it was time to deal with those permissions. A friend of Con's suggested a fstab entry using cifs rather than samba. For some reason it didn't work, but he'd used some interesting permissions parameters that I took onboard. Here's the fstab entry that finally fixed things for me;
//192.168.0.3/Public /windows/Public smbfs username=xxx,password=xxx,dir_mode=0777,file_mode=0777 0 0
The key here seems to be "dir_mode=0777,file_mode=0777" - allowing me to read and write to any folder in the partition. I've used username and password, but I think guest would be fine as long as those permissions are correct.
With my stability and permissions issues sorted, it was time to start experimenting again. Like I said, I kept things simple with cp. I'm only backing up a handful of text files, so I don't need incremental backups, but I do want timestamps and automatic deletion of old backups after a set time.
I started with a script that looked something like;
# Source on mounted NTFS data partition
sou="/windows/data/Documents and Settings/Adam/My Documents/Adam/Work/AAA In Progress"
# Destination on mounted FAT32 network drive
des="/windows/Public/ubuntubackup"
# create new folder on network drive
mkdir ${des}/1
# copy source to new folder
cp "${sou}"/* ${des}/1
Note that "${sou}" is in quotes in the last line, to cope with the fact there's spaces in the path to my source folder.
This was a good starting point but, with a little more research, I managed to make it more useful.
CONTINUED