Programming :: Create A Bash Menu Script For Home Server - Restore Files From A Backup?
Jan 19, 2011
I would like to create a bash menu script for my home server For instance if i were to type ./script It would then bring up 3 options
a. Create a backup
b. Restore files from a backup
If you were to select a or b it should then ask you were you want to backup or restore from. And if i were to type in an incorrect letter i should get an error and take me back to menu. I have attepmted this a view time now and have magaged to get the menu up using parameters
Im wondering how to create a menu in c like bash's select. I imagine there is already something out but I don't know what it would be. Im a c newb but been scripting for a long time now and trying to pick up a little c.this would be what I am looking to display:
1) option 1 2) option 2 3) option 3
Make a selection:obviously 1,2,3 would be the only valid selection and anything else would say invalid or something like that.
i am in need of linux help. iam at college and i need this back/restore script to pass this final part of an assessment. i require a backup script that will not only backup but also restore files to the relevent directories. e.g. users are instructed to store all wordprocessor files in a directory named wp. so i am needing to create a backup directory and 3 directories within that and some files within the 3 directories and then back them up ot restore them. l know i should/have to do this myself by been trying to get/understand info for the last few days and came up with zero.
I have a shell script that need to create some files:
1) backup files of user passed in file ( that will be written by this shell ).
2) temp files that the shell will create and later delete/remove.
This shell script will be used from my local dir ( I am not a super or a sysadmin ). Users of this shell will call this script to run on their local files in their respective directories. When my script runs, it errors with the following:
Im running ubuntu 10.04 and I recently had a little adventure whilst trying to disable KMS and deleted all the stuff out of the # kopt line and added the nomodeset thing.Now I crash to easybox everytime I try to boot, how do I restore the backup of said file that I noticed beside it in the folder. Also I saved one to my desktop.
So I've finally given up on saving my kubuntu install that wont boot. I've searched, and looked, but couldn't find a thing.My delema now is to make sure that I:
a) get all of the user data safely packed up onto my external USB drive. I believe it's all in the home directory. I'm not sure about getting hidden files though...
b) get the new install to go smoothly, and not mess up grub or the parralell XP install on the same hard drive.
c) get the user data back on the computer and recreate the user structure. Permissions were messed up already, so setting those up again is not an issue.
So, I've been poking around, and this is how I think things should go:
a) tar cvpjf backup.tar.bz2 /home to get my home directory backed up. Not exactly sure how to get from here to my external hd, but I'm sure I can figure it out
b) just run a live cd of kubuntu, delete the old partitions, and reinstall over them?
c) unzip the tar into by /home directory.
That's all I've been able to find so far. How do I set up the users? Will they show up as soon as I untar? Will the resinstall play nice with my windows install? Will I get all the hidden files too? Is there anything I'm missing?
I've recently started using Ubuntu as my main desktop operating system and I'm looking for a backup solution that is able to backup not only my documents and various other files that I have on the system, but I also need it to backup and create restore images for the operating system.
I have requirement on shell scriptingre scripts for the following: 1) Full backup(application and DB): tar all the files and database and copy them in the backup server 2) Incremental back up of files: backup of all the updated filester the last backup. 3) Restoring of backup files: restore the backup files from the backup server to the application server.
I've discovered that after restoring my site's backup this has happened to me again. How to delete the hacked /home/crocbits directory so that I can restore the backup under the same username. When I try to delete /home/crocbits I get this message when logged in as root:
I am doing a LVM replicate to another server. Example: server1.foo.com has / , /boot , swap and few LVM partitions. All are in /dev/sda disk of size 80GB. /dev/sda5 is a LVM partition which has only one vg00 and it has 2 LV's (/var and /usr) and a SAN storage connected to this server which has around 500GB of single partition(a LV partition) called /data and its under vg00 .
Now I have build another server called "server2.foo.com" with same RedHat OS version - RHEL 4 and want to import the same LVM setup at destination. Down time or unmounting the filesystem is not a problem (but am trying to reduce the down time as much as possible). Is there any way that I can take a proper snapshot of whole LVM disk and restore with same setup at destination without losing the data and the lvm file system layout?
I am pretty new to using Ubuntu and want to find a way that I can backup files remotely to my Ubuntu box. My Ubuntu box is running at work and I want to backup files from home automatically every night.Also which solution encrypts the data en route? For example a server with multiple clients with different directory paths.
I've got the following code and kludge. It's working okay except that there's a directory called "Archive" which I don't need to backup. I've tried various combinations of &&, -a, etc., and I'm kind of at a loss for getting this right.
Here's the code I have so far:
Code: #!/bin/sh # backup subdirs as individual tarballs with prepended timestamps and # move them somewhere else. # --exclude "/path/to/dir/*" (Doesn't seem to work)
How can I write that line so that I can loop through all of the subdirs, tarring them up, but excluding the "Archive" subdirectory?
the permissions for my home directory were accidentally changed from 'access files' to 'create and delete files', and I changed them back, but ever since then I am not able to change any preferences/settings at all. power management, themes, panels, emerald, anything. my user account is supposed to be the administrator, and all the user privliges are checked. how to get control of my computer back?
I take responsibility for data backup my centos server. Please help me backup data using tar. following scenario:- Sunday - full backup- the rest of differential backup.We're back up to full as follows:tar-cvzf / backup / backup-date.tar.gz / data
I have managed to write a bash script that moves files to the recylce bin instead of being deleted. Then (with a bit of assistance) wrote another bash script that deletes the files from the recycle bin. Now I need to write one that will restore the files preferably to their original location? I am very new to linux and stuggling with where to even begin...any ideas? There seems to be some advice about creating a cloning tree, but I've never heard of them?
I'm trying to create backup/archive my Ubuntu 10.04 system files (so I can restore it in case my system get corrupted). More specifically, I'm trying to zip the important files in my root directory not including my home directory (which includes my documents which I backup separately/more frequently) to an external hard drive attached via USB (called 'My Book').
Since File Roller didn't give me quite the level of control I was looking for, I created a script that I could execute to backup and archive regularly. Here's a snippet: cd /media/"My Book"/"Linux Backups" NOW=$(date +"%b-%d-%y") LOGFILE=Backup_Root_FileSystem-$NOW.log sudo zip -r -T -v Backup_Root_FileSystem-$NOW / -x /media/'My Book'* /media* /proc* /sys* /mnt* /dev* /cdrom* /home* /'lost+found'* | tee -a $LOGFILE
I have a production server to which you need to be approached with caution. I have to update the 107 packets between other kernel php and several libraries.
This is the first production server on such a scale, and he did not want me to get something went wrong. And if you can make a restore point after installation so that if it does not start I will be able to restore support the package versions?
I would like to develop a shell script that would automatically run a backup program and then shutdown the computers, but I do not know the first thing about script development or even writing scripting.
I'd like to know what solutions do you, people, use to backup a live system that acts as a small home mail/file/irc/web server and some other purposes. For example, right now, to backup the mail, I have to stop fetchmail, kill vixie-cron to avoid any problem and then do the backup. Then restart vixie-cron.I wonder if there's any solution that will leave me do the backup without all this hassle.
Im running on Solaris 10 and I am trying to write a script that will look at all the directories in export.home and then grep for the those in passwd and will display the directories that don't have a password associated with them
Here is what I got so far but its not working. #!usr/bin/bash for i in 'ls /export/home' do test='getent passwd | grep $i' if [ $test="" ] then echo "No Home Diectories Found $i" fi done
All this does is display what was listed in the export.home. What I want it to do is just display what was not found in password.
I am envisioning a dialog menu with 2 sections, the top 2/3 a menu, then the bottom 1/3 is a message box. When you highlight a menu item it gives you a description of what it does in the message box. However I am not sure it is possible. Can this be done in BASH?
I have a file called list.txt with on word on each line that changes in length. I'd like to make a menu, each line being its own choice. I pieced together most of it the only thing missing is a failsafe for typing a number out of range