Results 1 to 10 of 10
  1.    #1  
    Is there an exclude option on the tar command in the Pre?

    I'm trying to do from root:

    Code:
    tar -cvf /media/internal/full_backup.tar . --exclude "/media"
    But I can't find a way to do an exclude. Anyone done something with this via tar or even cp? Trying not to have to manually walk directories to get a current state of the device.

    Edit: For clarification, would run this from /
    Edit: Removed errors
    Last edited by sacherjj; 07/07/2009 at 12:27 PM.
  2. #2  
    You may be able to build up the tarball in stages with the -r option to append files to the tarball, but you can't do it compressed like that, you would have to compress only at the very end.

    Go find a tar manual page for the details.
  3.    #3  
    I wouldn't care if it is compressed, just want to be able to exclude the media folder so I'm not doing a recursive tar.
  4. #4  
    this would be a great option to backup the full file system... so i don't have to redo all my working mods when i mess one up haha. Anyone?
  5. #5  
    your tar command has both x and c. You need to use c to create an archive, x is for eXtracting.
  6.    #6  
    Quote Originally Posted by joshewah View Post
    your tar command has both x and c. You need to use c to create an archive, x is for eXtracting.
    Yep. Corrected. The main thing I'm trying to do is figure out how to do the exclude.

    Not ideal, but currently using this:

    Code:
    tar -cvf /media/internal/backup.tar /bin /etc /md5sums /tmp /boot /home /root /usr /lib /sbin /var /opt
    Last edited by sacherjj; 07/07/2009 at 01:03 PM.
  7. #7  
    I see examples online like you showed it, but one man file I read said you need an equal sign like: --exclude=/media

    There is also an -X flag you give a file that you place exclusions in. I would add things like /proc and /sys to that as those aren't real files, they are generated by the OS at boot time.
  8.    #8  
    I can't get the busybox tar to recognize --exclude or -X.
  9. #9  
    Code:
    ipkg-opt install tar
    if you install the "tar - 1.22-2 - heavyweight version of the Tape ARchiver"

    can you utilize it instead of the busybox version? If so let me know what command line/syntax you use for backup... the tar command just confuses the crap outa me... as do most linux command functions lol

    ya it looks like after the optware install you can utilize the "heavyweight" version from

    Code:
    /opt/bin/tar
    let me know if this works our for you. would love to use it to back up my fs
  10. #10  
    If you have a linux or mac box, or windows with cygwin you could have sshd running and use rsync instead. It has excludes and would be well suited to backing up over network.

Posting Permissions