Welcome to Tech Support Forum home to more then 136,000 problems solved. Issues have included: Spyware, Malware, Virus Issues, Windows, Microsoft, Linux, Networking, Security, Hardware, and Gaming Getting your problem solved is as easy as:
1. Registering for a free account
2. Asking your question
3. Receiving an answer

Registered members:
* Get free support
* Communicate privately with other members (PM).
* Removal of this message
* See fewer ads.
* And much more..

 





Want to know how to post a question? click here Having problems with spyware and pop-ups? First Steps
Go Back   Tech Support Forum > Alternative Computing > Linux Support
User Name
Password
Site Map Register Donate Rules Blogs Mark Forums Read

Linux Support Linux - Operating Systems and Applications Support

Reply
 
Thread Tools
Old 04-25-2005, 07:39 PM   #1 (permalink)
Semi-Retired Manager, Microsoft Support
 
Chevy's Avatar
 
Join Date: Jul 2003
Location: Notlob
Posts: 5,183
OS: Vista Ultimate

My System

Scripts in FC3

Does anyone have any good sources for tutorials?

What I need to do is write a script that will back up a directory and it's data (and all subs) to a .tar file. Then burn that .tar to a CD, verify the burn, and then wait for the user to ok deleting the .tar.

Once the script works, I need to be able to schedule it to run every week (CRON?)

*I'm assuming that I can call an installed app to handle the burn*
__________________


“The man who smiles when things go wrong has thought of someone to blame it on. ”
- Robert Bloch

Last edited by Chevy : 04-25-2005 at 07:40 PM.
Chevy is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 04-25-2005, 08:11 PM   #2 (permalink)
Semi-Retired Manager, Microsoft Support
 
Chevy's Avatar
 
Join Date: Jul 2003
Location: Notlob
Posts: 5,183
OS: Vista Ultimate

My System

Ok ... this will show how new I am at all this ...

Will this command:

tar -cz /hold/sharebak.tar.gz /share

create an archive of the directory /share and all it contains, named sharebak.tar.gz, in the directory /hold?

Or am I way off?
__________________


“The man who smiles when things go wrong has thought of someone to blame it on. ”
- Robert Bloch
Chevy is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 04-25-2005, 08:16 PM   #3 (permalink)
Asst. Manager, Alternative Computing Forums
 
batty_professor's Avatar
 
Join Date: Jul 2004
Location: Hooterville Il 45 mi. east of St. Louis mo
Posts: 2,609
OS: Fedora Core 5 for now


Send a message via AIM to batty_professor Send a message via MSN to batty_professor Send a message via Yahoo to batty_professor
Link to page of backup applications. CDTARchive looks interesting, if you don't mind a graphical application. http://www.linux.org/apps/all/Admini...on/Backup.html
Another possibly interesting link for the Fedora user. http://www.linux.org/docs/ldp/howto/...WTO/index.html
and more How-to's from Linuxonline http://www.linux.org/docs/ldp/howto/...EX/howtos.html
__________________
It's better to know me and not need me than to need me and not know me. B.

While users are never under any obligation, if you feel the urge please feel free to visit our donation page. Every little bit helps.
And we thank you for your support.

Microsoft free Registered Linux user 397458

Last edited by batty_professor : 04-25-2005 at 08:30 PM. Reason: more
batty_professor is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 04-25-2005, 08:26 PM   #4 (permalink)
Semi-Retired Manager, Microsoft Support
 
Chevy's Avatar
 
Join Date: Jul 2003
Location: Notlob
Posts: 5,183
OS: Vista Ultimate

My System

BP -- thanks, I'll check it out

Plus, I see where I made my error ... I had to specify the output was to create a file that was gzipped (I kept the v option to see the verbose output)

tar -cvzf

then specify the destination

/hold/sharebak.tar.gz

then specify the source/target

/share

.... GUI is nice, but I think the cli is the way to learn ... plus, it really puts people in a state of awe when all they see is archaic looking commands ...
__________________


“The man who smiles when things go wrong has thought of someone to blame it on. ”
- Robert Bloch
Chevy is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 04-25-2005, 08:33 PM   #5 (permalink)
Asst. Manager, Alternative Computing Forums
 
batty_professor's Avatar
 
Join Date: Jul 2004
Location: Hooterville Il 45 mi. east of St. Louis mo
Posts: 2,609
OS: Fedora Core 5 for now


Send a message via AIM to batty_professor Send a message via MSN to batty_professor Send a message via Yahoo to batty_professor
You make a good point with the "awe" thing. Check the links I added to my prev. post too.
__________________
It's better to know me and not need me than to need me and not know me. B.

While users are never under any obligation, if you feel the urge please feel free to visit our donation page. Every little bit helps.
And we thank you for your support.

Microsoft free Registered Linux user 397458
batty_professor is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 04-25-2005, 08:36 PM   #6 (permalink)
Semi-Retired Manager, Microsoft Support
 
Chevy's Avatar
 
Join Date: Jul 2003
Location: Notlob
Posts: 5,183
OS: Vista Ultimate

My System

Quote:
Originally Posted by batty_professor
You make a good point with the "awe" thing. Check the links I added to my prev. post too.
I'll check them out ... thanks for the help.
__________________


“The man who smiles when things go wrong has thought of someone to blame it on. ”
- Robert Bloch
Chevy is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 05-04-2005, 01:12 PM   #7 (permalink)
Senior Member
 
gotissues68's Avatar
 
Join Date: Sep 2002
Location: Vancouver Washington, Mountain View CA and Atlanta GA you pick the week!
Posts: 716
OS: Linux/FreeBSD


Send a message via AIM to gotissues68 Send a message via Yahoo to gotissues68
!!!!!!!!!!!!!!!!!!!!!!!!!WARNING COMPLETELY UNTESTED!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


#!/bin/bash
SPEED = "24"
BACKUPDIR = "/home/chevsjunk/"
tar -cpvf backup-`date +%F`.tar $BACKUPDIR && \
dd if=../$BACKUPDIR/backup-`date +%F`.tar of=backup-`date +%F`.iso && \
cdrecord -v speed=$SPEED dev=0,0,0 -data ../$BACKUPDIR/backup-`date +%F`.iso && \
rm -rf ../$BACKUPDIR/backup-`date +%F`.tar && ../$BACKUPDIR/backup-`date +%F`.iso

think that should do ya =) save it to somewhere you'll remember.. not the backup directory though! and then add it to cron via the crontab -e command and follow what the other cron entries look like
__________________
gotissues68 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 05-04-2005, 01:24 PM   #8 (permalink)
Semi-Retired Manager, Microsoft Support
 
Chevy's Avatar
 
Join Date: Jul 2003
Location: Notlob
Posts: 5,183
OS: Vista Ultimate

My System

You are THE man!

I'll let you know how it works.

To clarify - BACKUPDIR is the destination .. and the source?

So, if I wanted it to tar a directory (and subs), placing the tar file in /hold

#!/bin/bash
SPEED = "24"
BACKUPDIR = "/home/chevsjunk/"
tar -cpvf /hold/backup-`date +%F`.tar $BACKUPDIR && \
dd if=../hold/backup-`date +%F`.tar of=backup-`date +%F`.iso && \
cdrecord -v speed=$SPEED dev=0,0,0 -data ../hold/backup-`date +%F`.iso && \
rm -rf ../hold/backup-`date +%F`.tar && ../hold/backup-`date +%F`.iso

?
__________________


“The man who smiles when things go wrong has thought of someone to blame it on. ”
- Robert Bloch
Chevy is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 05-04-2005, 01:31 PM   #9 (permalink)
Senior Member
 
gotissues68's Avatar
 
Join Date: Sep 2002
Location: Vancouver Washington, Mountain View CA and Atlanta GA you pick the week!
Posts: 716
OS: Linux/FreeBSD


Send a message via AIM to gotissues68 Send a message via Yahoo to gotissues68
BACKUPDIR is the directory that you are backing up, the destination .. If you were to just run the script it would assume that the destination is your current working directory. If you want to specify something else you could do this:

By the way the p flag to tar preserves permissions so that when you untar they aren't all screwed up which is pretty common (I've done it a number of times)


#!/bin/bash
#specify your CDR speed
SPEED = "24"
#specify the directory and any subdirectories under it that you want to backup
BACKUPDIR = "/home/chevsjunk/"
#speficy the destination directory for the tar'd files
DEST ="/hold"
tar -cpvf $DEST\backup-`date +%F`.tar $BACKUPDIR && \
dd if=../$DEST/backup-`date +%F`.tar of=$DEST/backup-`date +%F`.iso && \
cdrecord -v speed=$SPEED dev=0,0,0 -data ../$DEST/backup-`date +%F`.iso && \
rm -rf ../$DEST/backup-`date +%F`.tar && ../$DEST/backup-`date +%F`.iso
__________________

Last edited by gotissues68 : 05-04-2005 at 01:35 PM.
gotissues68 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 05-07-2005, 08:45 PM   #10 (permalink)
Semi-Retired Manager, Microsoft Support
 
Chevy's Avatar
 
Join Date: Jul 2003
Location: Notlob
Posts: 5,183
OS: Vista Ultimate

My System

Well, I'm getting ": bad interpreter: No such file or directory" when I run this script.

I'm wondering - it seems like there is no path variable like in SuSE or Windows. Many commands need to have the full path specified (shutdown for instance), regardless of me being logged in a root or a general user.

Maybe I did something wrong on install?
__________________


“The man who smiles when things go wrong has thought of someone to blame it on. ”
- Robert Bloch
Chevy is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Reply


Thread Tools

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -7. The time now is 02:46 AM.



Copyright 2001 - 2008, Tech Support Forum

Search Engine Friendly URLs by vBSEO

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82