LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-16-2003, 04:55 PM   #1
charlie123
Member
 
Registered: Jan 2003
Location: S.E. England
Distribution: Redhat 8.0
Posts: 64

Rep: Reputation: 15
My first ever real bash script!


hey, i spent a lot of today learning the bits and bobs of bash scripting, and i have made my first real bash script.
it is something that everyone probably has, it automatically backs up files/directories. If you are a non-root user, it will only back up your home directory, giving u the options to backup all hidden files/directories or not. If your root, it will backup your home directory (/root) aswell as any directories/files that u specify as 'system files'. it will also log the previous locations of the 'system files' for easy replacement.

lol you can tell this is my first ey, anyway i thort i might aswell make it publically available (cos i find it very useful, and i want to show it off! :P) so a link is attached below. all comments are welcome, but remember this is my first bash script, so some of my methods may be very crude / stupid, im sure there are programs/commands that automate some of my processes, but i dont know them, and it was more fun this way.

anyway here we go:
http://homepage.ntlworld.com/markcmc...x/backupnow.sh

weighs in at 252 lines btw. oh and if u decide to run it, make sure u havent got a /sys.backup directory, cos that is what it uses by default and it will overwrite anything that was previously there. i dont think anyone will be using that directory name but u never know.

Last edited by charlie123; 01-16-2003 at 05:02 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
bash command that lists all members of a group by their real names quadmore Linux - Newbie 4 11-07-2005 10:46 AM
send automatic input to a script called by another script in bash programming jorgecab Programming 2 04-01-2004 12:20 AM
bash script - incrementing a filename in a script tslinux Programming 10 08-05-2003 11:58 PM
bash script prob: how can i tell the script that a 'dd' has finished? Frustin Linux - General 2 04-02-2003 05:34 AM
real short newbi question (bash) sleepwalker1.0 Programming 2 10-26-2002 04:06 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration