The longest bash command of my career

Discussion in 'OT Technology' started by Peyomp, Mar 6, 2007.

  1. Peyomp

    Peyomp New Member

    Joined:
    Jan 11, 2002
    Messages:
    14,017
    Likes Received:
    0
    mysqldump --user=me --password=pass --no-create-db --no-create-info -w 'SUBSTR(myTimeStampField FROM 1 FOR 10) = SUBSTR(DATE_SUB(now(), INTERVAL 1 DAY) FROM 1 FOR 10)' myDatabase myTable | gpg --yes -e -a -o - -r [email protected] | mailx -s "Entries for `date`" [email protected]

    If you export your public key and copy it to the database server for encryption, you will need to sign it with that server's key. So, generate a key with 'gpg --gen-key' and then sign your public key with 'gpg --lsign [email protected]'

    I was totally unable to get gpg on OS X or solaris to manually adjust the trust of my public key, so signing it was the only choice. It works.

    Now, I know this is just two pipes and single set of back-ticks but... if you knew how long it took to get gpg to use my public key, and to get it to work without asking me if I was sure, and to get mysqldump to take a where clause, and to get it to generate useful output for hour - 1 after I happened to fix the timezone for that server, and to be sure it worked with the delay in mail delivery...

    Jesus christ, look what time it is :)
     
  2. babygodzilla

    babygodzilla I love rice

    Joined:
    Nov 5, 2001
    Messages:
    3,108
    Likes Received:
    0
    nice!

    off topic, but, what is the pro and con of OSX over Windows? :)
     
  3. Doc Brown

    Doc Brown Don't make me make you my hobby

    Joined:
    Mar 31, 2006
    Messages:
    16,404
    Likes Received:
    0
    Location:
    Ohio
    Did you mean pgp? :dunno:
     
  4. crazybenf

    crazybenf Active Member

    Joined:
    Nov 14, 2001
    Messages:
    15,575
    Likes Received:
    2
    good job getting it to work. :coold:
     
  5. Peyomp

    Peyomp New Member

    Joined:
    Jan 11, 2002
    Messages:
    14,017
    Likes Received:
    0
    1) Try a command like that in windows. Enough said.

    2) PGP is now GPG. Gnu makes it. God damn you're old.
     
    Last edited: Mar 6, 2007
  6. Joe_Cool

    Joe_Cool Never trust a woman or a government. Moderator

    Joined:
    Jun 30, 2003
    Messages:
    299,205
    Likes Received:
    516
    PGP is a corporate commercial product. GPG is a free equivalent based on pgp 2.6.2.
     
  7. Supergeek

    Supergeek New Member

    Joined:
    Jan 23, 2007
    Messages:
    1,855
    Likes Received:
    0
    Location:
    Colorado
    I've used stuff like that before. They're Frankenstein monsters.

    I remember PGP :( Damn I'm old.
     
  8. Joe_Cool

    Joe_Cool Never trust a woman or a government. Moderator

    Joined:
    Jun 30, 2003
    Messages:
    299,205
    Likes Received:
    516
    They're still around...

    www.pgp.com
     
  9. quzur

    quzur Active Member

    Joined:
    Mar 15, 2000
    Messages:
    14,384
    Likes Received:
    19
    Location:
    Chicago
    I wish I knew what all that meant :hs:
     
  10. P07r0457

    P07r0457 New Member

    Joined:
    Sep 20, 2004
    Messages:
    28,491
    Likes Received:
    0
    Location:
    Southern Oregon
    try something like LFS.... You'll have BASH commands *WAY* longer than that.
     
  11. Peyomp

    Peyomp New Member

    Joined:
    Jan 11, 2002
    Messages:
    14,017
    Likes Received:
    0
    If it was any longer than that, I'd make it a perl script.
     
  12. P07r0457

    P07r0457 New Member

    Joined:
    Sep 20, 2004
    Messages:
    28,491
    Likes Received:
    0
    Location:
    Southern Oregon
    you don't have perl avail during much of the LFS install
     
  13. Peyomp

    Peyomp New Member

    Joined:
    Jan 11, 2002
    Messages:
    14,017
    Likes Received:
    0
    Why do you need so many pipes for LFS?
     

Share This Page