Berkeley CSUA MOTD:Entry 43464
Berkeley CSUA MOTD
 
WIKI | FAQ | Tech FAQ
http://csua.com/feed/
2025/04/07 [General] UID:1000 Activity:popular
4/7     

2006/6/22-26 [Computer/SW/Languages/Misc, Computer/SW/Unix] UID:43464 Activity:nil
6/22    How do I make rsync exclude any directory containing
        a file named NOBACKUP ?
        \_ see --exclude in the man page.  and really you should have been
           able to find this yourself.
           \_ I did read the man page.  I really don't think it's that simple.
              I can easily exclude a DIRECTORY named 'NOBACKUP'.
              I can exclude a file named 'NOBACKUP'.  I don't see
              an easy way to exclude all files in a directory
              that contains a file named 'NOBACKUP'
              \_ That's a bit more complex. You will need to write a find script\
                 to generate a list of files, and exclude from taht list all
              \_ That's a bit more complex. You will need to write a find scripti
                 to generate a list of files, and exclude from taht list all
                 files that meet your criteria. Then have rsync use rsync's
                 --files-from=  option.  That or make a exclusions list
                 (Again with a find script) and use the --exclude-from option.
              \_ I want this feature too, maybe we should add it.
2025/04/07 [General] UID:1000 Activity:popular
4/7     

You may also be interested in these entries...
2012/4/27-6/4 [Computer/SW/Languages/Misc, Computer/SW/Unix] UID:54372 Activity:nil
4/27    I wrote a little shell script to collect iostat data:
        #!/bin/bash
        DATE=`date +%m%d`
        DATADIR=/var/tmp/user
        OUTPUTFILE=$DATADIR/$DATE.out
        while true
	...
2012/5/8-6/4 [Computer/SW/Unix] UID:54383 Activity:nil
5/8     Hello everyone!  This is Josh Hawn, CSUA Tech VP for Spring 2012.
        About 2 weeks ago, someone brought to my attention that our script
        to periodically merge /etc/motd.public into /etc/motd wasn't
        running.  When I looked into it, the cron daemon was running, but
        there hadn't been any root activity in the log since April 7th.  I
        looked into it for a while, but got lost in other things I was
	...
2011/10/26-12/6 [Computer/SW/Unix] UID:54202 Activity:nil
10/24  What's an easy way to see if say column 3 of a file matches a list of
       expressions in a file? Basically I want to combine "grep -f <file>"
       to store the patterns and awk's $3 ~ /(AAA|BBB|CCC)/ ... I realize
       I can do this with "egrep -f " and use regexp instead of strings, but
       was wondering if there was some magic way to do this.
       \_ UNIX has no magic. Make a shell script to produce the ask or egrep
	...
2011/7/30-8/10 [Computer/SW/Languages/Misc] UID:54148 Activity:nil 66%like:54150
7/29    Happy Sysadmin Day
        \_ our "sysadmin" today deleted /home. When we asked her why
           she said she didn't do it. When I checked the sudo logs,
           I found these two commands in order:
               COMMAND=/bin/rm -r /home testuser
               COMMAND=/bin/rm -r /home/testuser
	...
2011/5/19-7/13 [Computer/SW/Languages/Misc] UID:54115 Activity:nil
5/19    If script A runs, and calls script B ..... is it possible for me to exit\
        script A based on results of script B and not continue?
        \_ assume any shell
        \_ Yes.
           \_ without passing the result to some stupid temp file?
              \_ It sounds like you want "scriptb || exit", which will run
	...
2010/4/22-5/10 [Computer/SW/Languages/Misc] UID:53797 Activity:nil
4/22    In Linux is there an easy way to rename the scripts in /etc/rc?.d ?
        For example I want to set all the /etc/rc?.d/S91apache to S100apache
        so that it'll run the ramdisk BEFORE going to apache.
        \_ Sure, just move them.
           \_ I mean is there a script that will rename all of them
              for me? Like: setrc apache2 0 0 1 1 1 1
	...
2009/10/27-11/3 [Computer/SW/Unix] UID:53475 Activity:nil
10/27   http://www.maxgames.com/play/flash-mind-reader.html
        how does this work?
        \_ sh -c 'for ((i=0;i<10;i++)); do for ((j=0;j<10;j++)); do echo "$i$j-(\
$i+$j)" | bc; done ; done' | uniq
        \_ bash -c 'for ((i=0;i<10;i++)); do for ((j=0;j<10;j++)); do echo "$i$j\
-($i+$j)" | bc; done ; done' | uniq
	...
2009/8/19-9/1 [Computer/SW/Unix] UID:53285 Activity:nil
8/18    Hi again, new freebsd guy here again, in bash I was able to go
        LD_LIBRARY_PATH=/opt/foo/lib ./runmyapp
        I managed to do this in tcsh by using setenv in a shell script
        that setenv's the lib path and then executes $1, just wondering
        if there was a way to do it in 1 line from the cmd line as in bash?
        Thanks, btw %2c or %3c worked.  Freebsd, tcsh and vi forever!
	...
2009/5/5-6 [Computer/HW/Laptop] UID:52950 Activity:moderate
5/5     Is there a good (or standard) way to make an offline copy of a w
        ordpress blog (mine, not someone else's)? tia.
        \_ oh man.
           \_ I could cobble something together with curl / wget, but I'd
              rather not if there is a standard way of doing this.  I'm
              pretty new to wordpress / blogging and I just want to keep
	...
2009/2/10-13 [Computer/SW/Security, Computer/SW/Unix] UID:52552 Activity:nil
2/10    I have an sh file that does a mount.. the mount does an
        authentication. I previosly stored the username and password
        from zenity prompts. However, I can't get a return on the password
        field. The following only works on the username:
        mount -t davfs "http://blahblah.com/BLahUser11" /mountdir << EOF
        ${username}
	...
2009/1/14-22 [Computer/SW/Languages/Perl, Computer/SW/Languages/Misc] UID:52378 Activity:nil
1/13    I want to extract a couple integer from an xml file, mainly,
        xml file from http://weather.com so I can put it on my xplanet marker
        file. has anyone done similar things (parse and extract data
        from xml) using shell script instead of python/perl?
        in the world of perl, it make sense to dump things into a hash
        which i can easily extract key/value pair.  can i achieve similar
	...
2008/12/18-2009/1/7 [Computer/SW/Mail] UID:52279 Activity:nil
12/18   Campus USENET service will be terminated on 12/31.
        http://ls.berkeley.edu/mail/micronet/2008/1608.html
        \_ I emailed RobR to tell him. -ausman
        \_ The CSUA is considering asking campus to allow us to run NNTP for
           ucb.class.*, as bSpace sucks major major ass. Thoughts? --t
           \_ That's noble, but maybe the effort would be better spent
	...
2009/8/21-9/1 [Computer/SW/Unix] UID:53297 Activity:nil
8/20    When I use rsync to backup, it's pretty cool except in cases where
        I rename a directory name from the source. Rsync will just do
        a plain copy. Is there a program that'll detect renaming of
        directories (by checking for children files), or at least
        move them to a dated directory?
        \_ Not related but beware of using rsync as a backup tool.
	...
2009/7/17-24 [Computer/SW/OS/OsX] UID:53156 Activity:kinda low
7/17    -rw-r--r--@
        What does the "at sign" mean? This is on Mac OS. VMWare disk file.
        \_ The file has metadata attributes
           \_ How do I add/delete attributes to files? What about
              -rw-r--r--+ <-- what is the "+" sign? Also how do you make
              tar preserve these attributes?
	...
2009/2/26-3/5 [Computer/SW/Unix] UID:52653 Activity:nil
2/26    If I want to rsync a perforce or svn directory while users
        are checking things in, could I wind up with a corrupted copy?
        \_ sure why not.  if you are really cool, your copy of the svn
           repo is on LVM, and you snap the LVM to copy it.
           \_ It'll seem less cool when you realize you've taken a snapshot
              of a block level device, which only guarantees that this set of
	...
2008/8/27-9/3 [Computer/HW/Laptop, Computer/SW/OS/Linux] UID:50980 Activity:nil
8/27    I have a rather large linux partition.  I just got a new laptop
        and want to move all my settings and customization to that new
        computer.  how to do this?  I tried remastersys but it seems that it
        get stuck somewhere, and I am hoping it is not really trying to create
        a 26GB iso file.
        any ideas?  is there anyway i can back up my debian package database
	...
2008/6/10-13 [Computer/SW/OS/VM, Computer/SW/Unix] UID:50210 Activity:nil
6/10    Is there a handy guide to virtualizing an already running
        physical linux box into an instance of Vmware?
        \_ this probably isn't the "right" way, but I have many times
        just run rsync. ("rsync -vpa root@oldbox:/ /")  on a fresh virtual
        image.  Just make sure the partitions are the same on the virt disk
        as on the real disk and if you are using a new udev, kill the info
	...
2008/5/29-31 [Computer/HW/Drives] UID:50086 Activity:nil
5/29    Considering abandoning tape backups in favor of something like this:
http://www.thermaltakeusa.com/product/Storage/hdd_station/blacx/st0005u.asp
        Please convince me that I'm crazy.
        \_ why?
           \_ Why do I want you to convince me I'm crazy?
              \_ what are you trying to accomplish?  What is your context?
	...
2007/11/12-16 [Computer/SW/OS/Linux, Computer/SW/Unix] UID:48623 Activity:nil
11/12   how do i make a fail safe magical backup for my debian box
        that i can quickly boot from if the box explodes?
        \_ keep a linux live boot cd around for just such an emergency
           \_ And learn about 'dd'
        \_ I was hoping there was something as slick as CCC, for unix.
           \_ You can first duplicate the disk offline with dd, then just
	...
2007/11/12-16 [Computer/SW/Unix, Computer/SW/OS/OsX] UID:48607 Activity:high
11/12   Server nerds, CCC for mac is totally awesome.  is there somethng
        as cool and friendly for PC or unix?
        \_ Hi.  "CCC" is a free mac program known as "Carbon Copy Cloner".
           If you use a Mac, and have some sort of external usb or firewire
           drive, I recommend you spend 15 minutes downloading it and
           setting it up.  You can easily make a backup set up your data,
	...
2007/8/31-9/3 [Computer/SW/Unix] UID:47860 Activity:nil
8/31    Pretend I am going to be on a boat in the arctic.
        I want to upload whale song sound data while I am
        on my terrible internet connection in the middle of
        the arctic.  What would I use?  FTP seems so 80s.
        \_ FTP is a tool that works and does exactly the job you want.
           What's wrong with FTP?
	...
2007/5/5-7 [Computer/SW/Unix] UID:46533 Activity:low Cat_by:auto
5/4     Question. Say I have dir1/A and dir2/A. How do I collapse them
        together? I'm unable to do "mv dir1/A dir2" or "mv dir1/A/* dir2/A"
        \- cd /foo/.../source;tar cf - . |(cd /bar/.../dest;tar xfBp -);rm -rf .
        \_ cp dir1/A/* dir2/A; rm -rf dir1/A?  What exactly are you trying to
           do and why can't you use mv?
           \- * globbing is risky with unknown inputs. when you want to
	...
2006/11/2-3 [Computer/SW/Unix] UID:45114 Activity:nil
11/02   I have a bunch of directories with files (and other directories)
        in them. I have a mirrored copy that contains many of the same
        files, but with different dates. Is there an easy way (short of
        writing s/w to check each file against the other) to do something
        like : If date on mirror < 10/31, then sync date with other dir?
        I don't think rsync can help with this. I just need the dates
	...