gzip and encrypted in a shl script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting gzip and encrypted in a shl script
# 1  
Old 11-08-2010
gzip and encrypted in a shl script

After I move the file to a directory, I need to gzip and encrypted.
I never do this in a shl script, I do it from the command line and it works..
cd /home/nelnet

spinel:/home/nelnet$ gpg -e 2010_11_07_05_11_xxxxxx_bills.dat.gz
`/home/nelnet/.gnupg/gpg.conf'
`/home/nelnet/.gnupg/gpg.conf'
You did not specify a user ID. (you may use "-r")

Current recipients:

Enter the user ID. End with an empty line:
You did not specify a user ID. (you may use "-r")

Current recipients:

Enter the user ID. End with an empty line: epass
This works in the command line, it gzip and encrypted the file

If you can point me in the right direction, I will appreciated
Image
# 2  
Old 11-08-2010
though the question is not clear, use the --recipient option as printed in error.

refer step 4 here Gpg Key-Pair Encryption and Decryption Examples
# 3  
Old 11-08-2010
Let me see if I can clarify this better: (new a shl scripts and under some pressure to finish this)

I need to take a file from a directory, the last version so I am doing something like this:

$last ls -1 *the_bills.dat* | tail -1

then I need to copy that file to another directory;

After I move the file to a directory, I need to gzip and encrypted.
someting like gzip name of the file.
then encrypted

something like
gpg -e 2010_11_07_05_11_xxxxxx_bills.dat.gz
when you run this command:

It ask you for
You did not specify a user ID. (you may use "-r")

Current recipients:

Enter the user ID. End with an empty line:
You did not specify a user ID. (you may use "-r")


I now the id, (how I can do this in a shl script?)
Also
When you look for the last version of the file in the directory
You do something like this
$last ls -1 *the_bills.dat* | tail -1

And it works you grab the last version of the directory.
But I need to copy the file to another directory
If the file is store in $last(sorry for my ignorance) ?
So you say
Cp $last to the directory?

How I can store the user ID?

So when I have this question
Enter the user ID. End with an empty line: (you entered here)

All this work from the command line, but it I need to put it in a shl script.




# 4  
Old 11-08-2010
By default GnuPG encrypts using Public keys. I think you'll want the --symmetric switch, in combination with the --password-fd switch. See the man page for gpg for more details.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Encrypted password in script

How to keep encrypted password in a shell script.? I have the file which has the following: a.sh ----- username=abc password=abc I will be using this username and password in another script. But I don't want to reveal the password in the script. How to keep the password... (3 Replies)
Discussion started by: sanvel
3 Replies

2. UNIX for Dummies Questions & Answers

Execute a encrypted shell script

Hi All, I have a shell script test.sh. I encrypted it using the command vi -x test.sh , and protected it with a password to view the file. When i tried to execute the file with ./test.sh..It is trying to execute the encrypted file but not he original one. Can someone help me with how to... (1 Reply)
Discussion started by: pracheth
1 Replies

3. Shell Programming and Scripting

Problems coping a file in a shl script

I have the following in a shl script: SCRIPT_PATH="/u01/app/banner/test/skid/plus/"; FILE_PATH="/nfs/mercury/u03/banner/test/skid/log"; LIST_FILE_PATH="/u01/banjobs/TEST"; SCRIPT_NAME="szpcal1.sql"; FILE_NAME='new_applicant_list'; I want to copy the file FILE_NAME to LIST_FILE_PATH ... (10 Replies)
Discussion started by: rechever
10 Replies

4. Shell Programming and Scripting

Encrypted script not working

I've encrypted a script in rot-13. When executed, I want the script to decrypt into a temporary file then run itself, and when it's exited then delete the temporary file. so at the moment I have this: #!/bin/sh FIFO=/tmp/__scriptname_$(date +%F)_$$ rm $FIFO >/dev/null 2>/dev/null mkfifo... (12 Replies)
Discussion started by: Trichopterus
12 Replies

5. Shell Programming and Scripting

Need to decrypt a file in a directory (SHL script)

I need to decrypt a file in a directory, I need to write a shl scrip & cron job How I find the files in the directory: the file is like this: dailypayments_sfs_payment_201011151800.dat -d The decrypt command: gpg -o dailypayments_sfs_payment_201011151800.dat -d 20101115 (the date... (7 Replies)
Discussion started by: rechever
7 Replies

6. Shell Programming and Scripting

last file in a directory in a shl script

I want to capture a last file in a directory in a shl scrip Cd to the directory $last ls -1 *the_bills.dat* | tail -1 This is not problem, but I need to copy that file to another directory, but in order to be able to copy to that directory, I need to su in unix, I am sure my sistem... (2 Replies)
Discussion started by: rechever
2 Replies

7. Shell Programming and Scripting

This code works in the command line but not in a shl script

When I run this code from the command line works spinel.middlebury.edu:/u02/sct/banner/bandev2/middlebury/shl:DEV2$ ls ef* eftseq.dat spinel.middlebury.edu:/u02/sct/banner/bandev2/middlebury/shl:DEV2$ file_seq=$( < eftseq.dat) ... (1 Reply)
Discussion started by: rechever
1 Replies

8. Shell Programming and Scripting

Reading a file (one record) in a SHL script

I am trying to read a file in a shl script (only one record) and stored in a variable file_number I got the following read -u $BANNER_HOME/xxxxxxx/misc/EFTSQL.dat file_number file_number2 = $file_number + 1 echo $file_number2 > $BANNER_HOME/xxxxxx/misc/EFTSQL.dat EOF It is not working... (2 Replies)
Discussion started by: rechever
2 Replies

9. Shell Programming and Scripting

shl script capture a file

need to be able to capture a file with the following conditions: The filenames are, for example, 3526_332840.dat, where 3526 is constant, and 332840 is a sequential number which is always a couple hundred greater than the previous day's file. I want to be able to change this script to acoomplish... (1 Reply)
Discussion started by: rechever
1 Replies

10. Shell Programming and Scripting

executing an encrypted script

Can we execute an encrypted shell script . I encrypted a shell scripts with crypt with keys and tried to execute it it gave me segmentation faul?? Can somebody answer this one please?? If we can is there any settings i need to change?? Thanks (2 Replies)
Discussion started by: ajnabi
2 Replies
Login or Register to Ask a Question