Page 3 of 3 FirstFirst 123
Results 21 to 27 of 27

Thread: [SOLVED] backup /var/cache/apt/archives shell script

  1. #21
    Join Date
    Jun 2007
    Location
    Bombay,India
    Beans
    1,579
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: backup /var/cache/apt/archives shell script

    hmm,thanks.In short,the script is correct.Now,I've to just mark the thread solved and figure out from man cron how to add this task to run every 100 days.And please don't spoil the fun of me finding out myself by posting here.

  2. #22
    Inxsible's Avatar
    Inxsible is offline Badabing Badabang Badaboom...Sucker!
    Join Date
    Feb 2006
    Beans
    4,996

    Re: backup /var/cache/apt/archives shell script

    Quote Originally Posted by meindian523 View Post
    The script now looks like this:
    Code:
    #!/bin/bash
    
    filename=$(date +%d-%m-%Y)
    cd /var/cache/apt/archives && tar -cf /home/easwarh/$filename *.deb && bzip2 -z /home/easwarh/"$filename.tar"
    
    apt-get clean
    and I get something different now.Progress?I'm not sure.

    Code:
    easwarh@l1nuxr0cks:~/Desktop$ ./try1 
    tar: *.deb: Cannot stat: No such file or directory
    tar: Error exit delayed from previous errors
    E: Could not open lock file /var/cache/apt/archives/lock - open (13 Permission denied)
    E: Unable to lock the download directory
    easwarh@l1nuxr0cks:~/Desktop$
    I think you have a space between filename and *.deb. That's why you are getting the deb error
    Shed that weight!! -- Apps | Window Managers

    Arch + i3 (tty1) Arch + wmfs (tty2)

  3. #23
    Join Date
    Jun 2007
    Location
    Bombay,India
    Beans
    1,579
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: backup /var/cache/apt/archives shell script

    I did sudo apt-get clean,NOT autoclean.Autoclean,IIRC,cleans the archives every so many days or whatever you set.

  4. #24
    Join Date
    Feb 2007
    Beans
    4,045
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: backup /var/cache/apt/archives shell script

    For more bash-goodness, read the Bash Guide for Beginners, and if you want to get really dirty, read the Advanced Bash-Scripting Guide as well.

    http://www.tldp.org/guides.html

    ps. They use a lot of examples!
    Last edited by geirha; June 30th, 2008 at 07:41 PM.

  5. #25
    Inxsible's Avatar
    Inxsible is offline Badabing Badabang Badaboom...Sucker!
    Join Date
    Feb 2006
    Beans
    4,996

    Re: backup /var/cache/apt/archives shell script

    Quote Originally Posted by meindian523 View Post
    ....[snip]And please don't spoil the fun of me finding out myself by posting here.
    Code:
    00 00 */100 * * /path/to/script
    MUHAHAHAHAHAH
    Shed that weight!! -- Apps | Window Managers

    Arch + i3 (tty1) Arch + wmfs (tty2)

  6. #26
    Join Date
    Jun 2007
    Location
    Bombay,India
    Beans
    1,579
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: backup /var/cache/apt/archives shell script

    Nopes,I don't think that space is the problem,because otherwise,how do you differentiate between what has to be tarred and where it has to be tarred to.And no,I didn't read that Muhahaha post,and even if I did,I'm going to man cron.

  7. #27
    Inxsible's Avatar
    Inxsible is offline Badabing Badabang Badaboom...Sucker!
    Join Date
    Feb 2006
    Beans
    4,996

    Re: backup /var/cache/apt/archives shell script

    Quote Originally Posted by meindian523 View Post
    .....[snip]and No,i Didn't Read That Muhahaha Post,and Even If I Did,i'm Going To Man Cron.
    Lol
    Shed that weight!! -- Apps | Window Managers

    Arch + i3 (tty1) Arch + wmfs (tty2)

Page 3 of 3 FirstFirst 123

Tags for this Thread

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
  •