[Request]Small script for linux

Results 1 to 6 of 6
  1. #1
    (oO (||||) (||||) Oo) jM2.me is offline
    MemberRank
    Aug 2009 Join Date
    USA (Fuck Yeah)Location
    2,527Posts

    [Request]Small script for linux

    Need small help. Basically script to zip folder to specific location with name "backup_%date%"

    Save to folder: /extended/hdd2_1000/
    Save this folder: /extended/hdd1_320/

    Thanks :)
    Last edited by jM2.me; 02-08-10 at 06:35 PM.


  2. #2
    Ginger by design. jMerliN is offline
    MemberRank
    Feb 2007 Join Date
    2,497Posts

    Re: [Request]Small script for linux

    Quote Originally Posted by DanSpd View Post
    Need small help. Basically script to zip folder to specific location with name "backup_%date%"

    Save to folder: /extended/hdd2_1000/
    Save this folder: /extended/hdd1_320/

    Thanks :)
    PHP: Zip - Manual

  3. #3
    Account Upgraded | Title Enabled! Mindblaster7 is offline
    MemberRank
    Oct 2008 Join Date
    DenmarkLocation
    773Posts

    Re: [Request]Small script for linux

    jMerlin: I think by "script for linux" he means a bash script.

    Here's one I wrote down quickly, nothing fancy but gets the job done.

    Code:
    #!/bin/bash
    
    DIR_TO_TAR="/home/andreas/stuff"
    TARGET="/home/andreas/backups"
    TODAY=$(date +%d-%m-%y)
    FILENAME="backup_$TODAY.tar"
    
    cd $TARGET && tar -cvvf $FILENAME $DIR_TO_TAR
    Remember to change the variables so they fit to your setup, save it, chmod it and run it.

  4. #4
    (oO (||||) (||||) Oo) jM2.me is offline
    MemberRank
    Aug 2009 Join Date
    USA (Fuck Yeah)Location
    2,527Posts

    Re: [Request]Small script for linux

    Quote Originally Posted by Mindblaster7 View Post
    jMerlin: I think by "script for linux" he means a bash script.

    Here's one I wrote down quickly, nothing fancy but gets the job done.

    Code:
    #!/bin/bash
    
    DIR_TO_TAR="/home/andreas/stuff"
    TARGET="/home/andreas/backups"
    TODAY=$(date +%d-%m-%y)
    FILENAME="backup_$TODAY.tar"
    
    cd $TARGET && tar -cvvf $FILENAME $DIR_TO_TAR
    Remember to change the variables so they fit to your setup, save it, chmod it and run it.

    Thanks :)

    Thumbs up for you

  5. #5
    Ginger by design. jMerliN is offline
    MemberRank
    Feb 2007 Join Date
    2,497Posts

    Re: [Request]Small script for linux

    Or he could just use the tar command himself and RTFM (read the f'ing manpage).
    ;o

  6. #6
    (oO (||||) (||||) Oo) jM2.me is offline
    MemberRank
    Aug 2009 Join Date
    USA (Fuck Yeah)Location
    2,527Posts

    Re: [Request]Small script for linux

    Quote Originally Posted by jMerliN View Post
    Or he could just use the tar command himself and RTFM (read the f'ing manpage).
    ;o
    jMerlin no offense but you are being a weird nerd.

    I am no linux but have to deal with it sometimes. All I asked for a script to pack folder with specific zip name with date.

    I modified it and using it. Thanks to Mindblaster7

    Opposite to you.

    Thread closed...



Advertisement