LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 03-26-2011, 11:31 PM   #1
ramesh14
Member
 
Registered: Apr 2008
Location: Hyderabad
Distribution: RHEL5,Fedora 8/9
Posts: 119
Blog Entries: 1

Rep: Reputation: 15
a shall script for remote shell execution


hi

i need to take the backup some folders encryption formate with password i used gpg encription in the script
but it is not taking the password it throos error

the syntax is
#!/bin/bash
tar -cvzf test.tar.gz target ; echo "test" | gpg -c test.tar.gz --stdin
thanks in addvance

but it is not working pleas

Last edited by ramesh14; 03-28-2011 at 07:53 AM.
 
Old 03-27-2011, 04:12 AM   #2
EricTRA
Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290
Hello,

How are you executing the cronjob? As root or as a regular user? It's always good practice to put full paths for the commands you use in a shell script that will be executed through crontab. Also check the permissions on the script. Have you tried manually to launch the script to see what happens? If so, what errors do you get?

Kind regards,

Eric
 
1 members found this post helpful.
Old 03-27-2011, 05:11 AM   #3
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
First of all, take away the "v" option. Redirect stderr to /dev/null or a log file. Scripts running in cron have no attached terminal, so trying to read input or print will cause the job to stall.

There isn't an --stdion option for gpg. Also, receiving from stdin you would loose the filename.

If you run gpg manually, does it prompt for a password? If so, this won't work for a cronjob.
 
1 members found this post helpful.
Old 03-27-2011, 07:59 AM   #4
CroMagnon
Member
 
Registered: Sep 2004
Location: New Zealand
Distribution: Debian
Posts: 900

Rep: Reputation: 33
Unless it is a typo in creating your post, you haven't specified any files to add in the tar command. You should have a filespec or directory name before the semicolon.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Java hangs even though shell script’s execution is completed pavanlimo Programming 5 08-16-2010 03:49 PM
shell script execution on double click havejeet Linux - Newbie 6 06-05-2010 03:08 AM
How to control execution of programs in a shell script. Chrisantha1 Programming 5 04-28-2010 03:29 AM
Remote Script execution from the central location anil_garg5 Linux - General 5 05-11-2006 03:29 PM
Speeding up Shell Script execution?? funkymunky Programming 8 07-16-2004 08:39 PM


All times are GMT -5. The time now is 09:14 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration