Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 26

Thread: allowing incoming http requests-iptables-red hat 9.0

  1. #11
    Moderator
    Advisor
    redhead's Avatar
    Join Date
    Jun 2001
    Location
    Copenhagen, Denmark
    Posts
    811
    I have to back up data on a cd in red hat linux enterprise edition 4.I havnt tried it and wanted to backup it up automatically.Is there any software aviable
    I once made a script to do just that, it used cdrecord to check for an existing CD-R/CD-RW in the drive, if found it would use mkisofs to create a cd-image of the desired dierctories, then check if the image was of a size that would fit on the CD-R and if all was accepted, it would use cdrecord to burn it..
    If you wanted to make a backup, say right now, I'd incorporated it with a web-interface where you could see the status of last backup aswell as request a new one made etc..
    Sadly it's been 5 years since I was associated with the company who requested it, but I'll play around with cdrecord/mkisofs and dust off my old braincells, so I might have something of use later tonight..

    i tried loading avg antivirus in red hat linux 4 ,but it asks for 2 files

    pygtk2-2.0.0-1 RPM for i386
    pygtk2-libglade-2.0.0-1 RPM for i386

    i tried downloading but wasn't successful .do u know of any other sites
    If rpmfind.net dosn't have them, then I'm out of idears.
    pygtk2
    pygtk2-libglade
    Once uppon a time, I was involved with building a RedHat based distribution from scratch, but around the time when Gentoo became mainstream, I was fed up with all the dependency hassle, and switched to Debian...
    Since then I've barely touched any RedHat based systems...
    Don't worry Ma'am. We're university students, - We know what We're doing.
    'Ruiat coelum, fiat voluntas tua.'
    Datalogi - en livsstil; Intet liv, ingen stil.

  2. #12
    Moderator
    Advisor
    redhead's Avatar
    Join Date
    Jun 2001
    Location
    Copenhagen, Denmark
    Posts
    811
    Ok, I've made a small script, which should work... sort of... I havn't tested it, but if my calculations are correct, then it should work.. Altho it dosn't support dvd-r it should work with that aswell..
    Code:
    #!/bin/sh
    
    #
    # a small script to get cdrecord to take backup of something
    #
    
    # dir for temporary files
    DIR=/tmp/backup
    # cd-rw drive
    DEVICE=/dev/hdc
    # dirs to take backup of
    BACKUP_DIRS="/etc /home"
    # append current date to filename
    DATE_NAME=`$DATE +%b-%d-%Y`
    
    # needed programs
    CDRECORD=/usr/bin/cdrecord
    MKISOFS=/usr/bin/mkisofs
    DATE=/bin/date
    MKDIR=/bin/mkdir
    RM=/bin/rm
    TAR=/bin/tar
    BC=/usr/bin/bc
    ECHO=/bin/echo
    TAIL=/usr/bin/tail
    
    # check what we have in the drive... 
    ## WARNING  this may take some time ##
    CD_TRACKS=`$CDRECORD -s dev=$DEVICE -toc 2>/dev/null | grep 'track:'| wc -l`
    
    # Assuming it's a mulitsession if there are other tracks
    if [ $CD_TRACKS -gt 0 ]; then
      SESSION=`$CDRECORD -s dev=$DEVICE -msinfo 2>/dev/null`
      SESSION="-C $SESSION"
    fi
    
    # decide how much room we have on the cd-r
    CD_SIZE=`$CDRECORD -s dev=$DEVICE -atip 2>/dev/null | \
                      grep 'ATIP start of lead out' | awk '{print $6}'`
    if [ "$CD_SIZE"x = "x" ]; then
      CD_SIZE=359848
    fi
    CD_SIZE=`$ECHO "$CD_SIZE"*2048 | $BC -i | $TAIL -n1`
    
    # clean up after previus backups
    if [ -d $DIR ]; then
      $RM -rf $DIR >/dev/null  2>&1
    fi
    $MKDIR -p $DIR
    
    # packup what ever there is to backup
    $TAR --bzip2 -cf "$DIR/backup-$DATE_NAME.tar.bz2" $BACKUP_DIRS >/dev/null 2>&1
    
    # and record it to our cd-r
    TSIZE=`$MKISOFS -R -J -quiet -print-size $DIR`
    if [ $TSIZE -gt $CD_SIZE ]; then
      $ECHO "not enough room on the cd-r"
      exit 1
    fi
    
    TSIZE="$TSIZE"s
    $MKISOFS -R -J -quiet $DIR | $CDRECORD dev=$DEVICE \
                                     tsize=$TSIZE $SESSION - >/dev/null 2>&1
    I would like to hear, if it creates unknown errors...

    Else theres PHP backup maker or scdbackup

    And perhaps we could get a mod to split this thread, so these script like things will endup in Linux Scripts & Programming where this is more appropriate.
    Last edited by redhead; 08-07-2006 at 08:09 PM.
    Don't worry Ma'am. We're university students, - We know what We're doing.
    'Ruiat coelum, fiat voluntas tua.'
    Datalogi - en livsstil; Intet liv, ingen stil.

  3. #13
    Junior Member
    Join Date
    Mar 2006
    Posts
    57
    hi thks ,thats gr8 stuff.I will go thru it and let u know .It will also benefit other people who have similar problems

  4. #14
    Junior Member
    Join Date
    Mar 2006
    Posts
    57
    i m trying out the script which u gave me and also the 2 references of php and sdbackup.

    U had mentioned......
    If you wanted to make a backup, say right now, I'd incorporated it with a web-interface where you could see the status of last backup aswell as request a new one made etc..

    Is it possible ,kindly let me know.

    After backup ,if i wanted to restore it back to the same directory ,do i again need a script.

  5. #15
    Junior Member
    Join Date
    Mar 2006
    Posts
    57
    I tried running ur script ,but it gave me an error as

    line 14:+%b-%d-%Y: command not found.

    I then hard coded the date and when i ran the script ,it gave me blank blinking output...

    When ran the date command with the switches from root ,it gave me the correct out put...

    *******
    I have a ide based samsung cd writer ,when i gave a command

    cdrecord --dev=1,0,0 --blank=fast ,it gave me the following error..............

    Cdrecord-Clone 2.01-dvd (i686-pc-linux-gnu) Copyright (C) 1995-2004 Jörg Schilling
    Note: This version is an unofficial (modified) version with DVD support


    Note: and therefore may have bugs that are not present in the original.
    Note: Please send bug reports or support requests to http://bugzilla.redhat.com/bugzilla
    Note: The author of cdrecord should not be bothered with problems in this version.


    Is there a seperate version of cdrecord for IDe based cd-writers...

  6. #16
    Moderator
    Advisor
    redhead's Avatar
    Join Date
    Jun 2001
    Location
    Copenhagen, Denmark
    Posts
    811
    line 14:+%b-%d-%Y: command not found.
    Oops an error from my part.. Move the line
    Code:
     DATE_NAME=`$DATE +%b-%d-%Y`
    below all the # Needed programs
    I have a ide based samsung cd writer ,when i gave a command

    cdrecord --dev=1,0,0 --blank=fast ,it gave me the following error..............
    This is perfectly normal, it just tells you the cdrecord version you are using, is modified to support writing of dvd-r/w aswell..
    When using a IDE burner, you specify the device as your /dev/hd* where it's located, thats why my DEVICE setting in the script is specified as /dev/hdc
    So the commadn to execute it would be something like:
    > cdrecord dev=/dev/hdc blank=fast
    Theres no "--" infront of the arguments given, when it is somethign like dev and blank

    U had mentioned......
    If you wanted to make a backup, say right now, I'd incorporated it with a web-interface where you could see the status of last backup aswell as request a new one made etc..
    I must admit, the script I made back then, was alot more complicated and advanced than this one..
    But any web-server on the machine, which provides some form of serverside execution of a script, will suffice to create a web-wrapper around the script.

    The one I've made here, was temporarily thought of as a simplified one, capable of beeing activated from crontab or the like...
    After backup ,if i wanted to restore it back to the same directory ,do i again need a script.
    The script will place a tar archive on the cd, containing the directories mentioned in the BACKUP_DIRS To restore, it's as simple as doing:
    > tar --bzip2 -C / -xf /mnt/cdrom/backup-date.tar.bz2
    Last edited by redhead; 08-08-2006 at 04:43 PM.
    Don't worry Ma'am. We're university students, - We know what We're doing.
    'Ruiat coelum, fiat voluntas tua.'
    Datalogi - en livsstil; Intet liv, ingen stil.

  7. #17
    Junior Member
    Join Date
    Mar 2006
    Posts
    57
    thks

    i will go thru ur ans.Yup i forgot to mention the hd device for the cdwriter.

  8. #18
    Junior Member
    Join Date
    Mar 2006
    Posts
    57
    i tired putting the date command after the All needed programs,but i again got the same error on LINE NO 28.
    **

    the command cdrecord dev=/dev/hdc blank=fast ,worked fine.The cdrec should not be mounted before executingthis command ,since i got an error.

    It blanked the cd (10x samsung cd-rw)in abt 10 secs ,but when i tired to mount it i got the following error....

    i/o error sector 0

    can't read super block.
    i tried reading it in windows,same problem

  9. #19
    Moderator
    Advisor
    redhead's Avatar
    Join Date
    Jun 2001
    Location
    Copenhagen, Denmark
    Posts
    811
    Are you sure you have the date program located as /bin/date since it's working fine on my system.
    When blanking a CD-r/w you simple prepare it for writing something to it, you dont create a filesystem on it, thats why it can't be mounted, it's after you've writting an iso file or some other things to it, it will contain a filesystem.
    Don't worry Ma'am. We're university students, - We know what We're doing.
    'Ruiat coelum, fiat voluntas tua.'
    Datalogi - en livsstil; Intet liv, ingen stil.

  10. #20
    Junior Member
    Join Date
    Mar 2006
    Posts
    57
    sorry ,the /bin/date program was located perfectly.I had made a small mistake while editing first time as i had changed the date to lower case in `$DATE +%b-%d-%Y` .Its not giving error now after i shifted it below the needed programs.

    I wanted to check the backup on a cd-rw ,but i will check it on cd-r and let u know.
    ****************
    regd blanking the system i issued the command cdrecord dev=/dev/hdc blank=fast and it formated the cd in abt 15 secs.I didn't create any file system.

    Now the problem is that if i try to read any cdrw it gives an error.I can read a cdr properly.

    where am i going wrong.

Similar Threads

  1. How to forward local HTTP requests to remote Proxy with IPTables ?
    By asdamha in forum Linux - Hardware, Networking & Security
    Replies: 1
    Last Post: 05-12-2011, 11:51 AM
  2. iptables http forwarding problem
    By sirstan in forum Security
    Replies: 1
    Last Post: 04-23-2008, 11:24 AM
  3. Problem recving HTTP requests when Apache listens on port 80
    By hecter in forum Linux - Hardware, Networking & Security
    Replies: 1
    Last Post: 10-30-2004, 05:27 AM
  4. IPTABLES: block ALL incoming and outgoing except...
    By Blaqb0x in forum Linux - Software, Applications & Programming
    Replies: 2
    Last Post: 07-06-2004, 03:17 AM
  5. SSH Not allowing users to login?
    By Rastar in forum Linux - Hardware, Networking & Security
    Replies: 9
    Last Post: 05-08-2003, 06:12 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •