Fedora Linux Support Community & Resources Center
  #16  
Old 10th December 2008, 03:22 AM
C4talyst Offline
Registered User
 
Join Date: Mar 2007
Posts: 90
Appreciate it Nick. I'm pretty close now. I wanted the script to check data1 directory for new files, move them to data2 directory, encrypt them with gpg and then delete all original files in data1. Sounds simple right? For you guys anyways...
Reply With Quote
  #17  
Old 10th December 2008, 03:27 AM
Dan's Avatar
Dan Offline
Administrator
 
Join Date: Jun 2006
Location: Paris, TX
Posts: 22,324
Not a problem. Just a couple of mouse clicks. Not sure I'd call that real work.

Well, you're in good hands with Nick.

Later.
__________________
Signature Links | New Posts | Who's on the forums (right now) |

© ® ™ № ¿
Reply With Quote
  #18  
Old 10th December 2008, 03:32 AM
papal's Avatar
papal Offline
Registered User
 
Join Date: Nov 2008
Posts: 81
Code:
#!/bin/sh

dirpath1="/home/user/data1/"
dirpath2="/home/user/data2/"

cd $dirpath1;
for file in *.new
do
  echo "$file"
  gpg -r USER_ID --output "${dirpath2}${file}.gpg" --encrypt "$file"
  if [ $? -eq 0 ]
  then  
    rm -f "$file"
  else
    echo "ERROR: encrypting $file"
  fi
done
Reply With Quote
  #19  
Old 10th December 2008, 03:34 AM
nick.stumpos's Avatar
nick.stumpos Offline
Registered User
 
Join Date: Feb 2005
Location: Lansing, Mi
Age: 28
Posts: 2,222
simple enough sounds like your almost there. i have to ask though, if your going to delete the original files, why copy than delete why not just encrpt first and if it succeeds move.
blah nevermind didnt really read the above script. it creates than only deletes if succeeds . good stuff ignore me.
__________________
As always
Love, Life, Loyalty, Wisdom, Knowledge, And Understanding
FC6: Common Questions answered

Last edited by nick.stumpos; 10th December 2008 at 03:36 AM.
Reply With Quote
  #20  
Old 10th December 2008, 03:36 AM
C4talyst Offline
Registered User
 
Join Date: Mar 2007
Posts: 90
I guess because I don't have all my requirements hammered out just yet. I just know this is where I need to start...thanks a lot Nick and papal for you help!
Reply With Quote
Reply

Tags
assistance, paid, scripts, shell

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Functions in shell scripts. Please help! GrahamB Programming & Packaging 8 18th April 2005 05:32 AM
Executing Shell Scripts DZack Using Fedora 3 9th March 2005 04:02 AM
little help with shell scripts please ieuuk Programming & Packaging 3 8th January 2005 09:32 AM


Current GMT-time: 14:06 (Wednesday, 19-06-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat