Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
It has been a while since I have used Linux so this might no longer be an issue, but when I last used Linux if I had a network share (/media/Backups) and I had a backup app backing up to the Share I found that if the back software tried to run when the Share wasn't mounted then the Backups were done to the folder /media/Backups instead of the network device that was mounted as /media/Backups, does any know if this is still an issue and if it is how I can get arround it?
Most UNIX/Linux backup solutions backup directories. When you mount a share you mount it on a directory (which is called a mount point in that case). When you unmount the share the directory is still there. There is no way for backup software to determine whether you meant to backup a share when you told it to backup a directory. (Although many do have options for crossing nfs mount points that isn't quite the same thing.)
You apparently are used to the Windoze way of doing things where each mount of a share gets its own drive letter. That isn't the Linux way.
Many backup software packages do have options that allow you to run pre and post backup scripts. You could put in a pre script that checks to see if the share is a mount or a local directory. Alternatively you could create a script that does this then kicks off the backup from command line.
Also the reason many backup packages have an option to allow for crossing nfs mount points but don't do it by default is that it makes more sense to backup the filesystem on the system that shared it out than it does to do it on the system that has imported and mounted it. This is because:
1) Shares are often sent to multiple systems. You don't really need to do 20 backups of the same filesystem every night.
2) Shares are done over the network. This means any backup you do of a share is using network resources to essentially copy from the exporting system to the system it is mounted on. This is on top of the network bandwidth you are using to do the backup if you have a centralized backup server.
What backup software are you using?
How many times is the filesystem shared out?
Why can't it be backed up from the exporting system rather than the importing system?
Are you using automounter to mount the filesystem?
Thanks for your reply, yes I am mainly used to Windows, but getting close to at last dumping it (just need to get work to give me a remote access from home method that doesn't require Windows!)
As for your questions, please see below
What backup software are you using?
Back In Time
How many times is the filesystem shared out?
currently the Shares are used by 2 PC's (1 Ubuntu box and 1 Win 7 box)
Why can't it be backed up from the exporting system rather than the importing system?
The backup is running from the PC and I am trying to backup to the Share on my QNAP NAS, I don't know of away of doing it the other way around.
Are you using automounter to mount the filesystem?
Not sure, how do I tell, I can tell you I am currently using Ubuntu 10.10 if this helps
Unfortunately I don't know "Back In Time". I see from links that it has "Options" and "Expert Options" tabs and perhaps one of those allows for the pre and post scripting I mentioned.
Since it is NAS it explains why you aren't backing up from exporting system. (Though many NAS devices provide their own snapshot technology.)
Since you share to both Windows and Ubuntu I'm wondering if this is a Samba mount rather than NFS mount on Ubuntu. (SMB/CIFS is the way Windows mounts shares and Samba allows for doing that in UNIX/Linux.)
You may want to explore the Back In Time stuff to verify it allows for backup of nfs and samba shares.
If the filesystem is a hard mount it should be in your /etc/fstab. If it is an automount it would be found in one of the files in /etc (grep for it in /etc/*auto*).
I will have to check what I have my NAS Share mounted as once I am home tonight but I do know I have both SAMBA and NFS Services enabled on the NAS.
Back In Time doe's not have options to run post-scripts, but as all it does is add a simple entry to cron I hopefully should be able to edit the cron job to mount and dismount the share
would something like this work
Code:
mount -t smbfs -o username=<username>,password=<password> //192.2.1.150/Backup /media/Backup
// Do I need to check if it has mounted here?
backintime -b
umount /media/Backup
I'd put the check before the mount not after it. No point in trying to mount if it's already there:
Something like:
Code:
if ! df /media/Backup |grep 192.2.1.150
then mount -t smbfs -o username=<username>,password=<password> //192.2.1.150/Backup /media/Backup
fi
backintime -b
umount /media/Backup
The "grep 192.2.1.150" will should only match if it finds it as a mount from that IP. Otherwise it will find it as a local filesystem (e.g. part of the root [/] filesystem) and should skip trying to mount it.
You could put another check after the mount to verify it mounted and only run the backintime after that.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.