Sankarshan Mukhopadhyay wrote:
If you are doing this for the user's /home, it would perhaps be a safer option not to require that things get dumped into /root etc thus saving you the trouble of playing around with permissions and the like.
Actually at first i backup /etc/ and /var in my home directory under a separate folder and then backup /home in the external drive. so while the script is executing the only static place i can think of is /root and as i run the script from terminal as root it seems much easier.
Sankarshan Mukhopadhyay wrote:
And, is there a particular reason that you are checking for whether the user is already logged in ? Nothing specific, was interested in the UseCase.
if a user is logged in when his home directory is being backuped he may be running some process in the foreground or background , knowingly or unknowingly which may change some files in the home directory continuously which may not be caught by rsync. so i feel it is safer to just log out the user so that all processes owned by he or his group end. Shakthi Kannan wrote:
* What is blkid here? If you have many USB-storage devices, how can you tell which one to use? Checking for appropriate device can be done with udev.
i have labled my usb drive with a specific name so that easily separates between many usb drives. Though now i have read up on udev thanks to your link, i feel udev is more efficient and i will try to incorporate udev in my script. --- On Wed, Dec 31, 2008 at 9:54 AM, partha chowdhury <[email protected]> wrote:
| #checks if destination folder exists | if [ -d /media/backup ]
Shakthi Kannan wrote:
No magic numbers. Use a variable.
sorry i could not understand what you meant to say. Can you please explain a bit ? Shakthi Kannan wrote:
You can write udev rules on connection of a particular USB device to perform actions such as syncing/backing up files: http://www.reactivated.net/writing_udev_rules.html#external-run
Thanks for the link. I am reading up on this and i will rewrite my script. _______________________________________________ Users mailing list [email protected] http://lists.dgplug.org/listinfo.cgi/users-dgplug.org
