Sponsored Content
Full Discussion: Sftp in a crontab
Top Forums Shell Programming and Scripting Sftp in a crontab Post 303012927 by rbatte1 on Monday 12th of February 2018 12:31:39 PM
Old 02-12-2018
If you could post the output (in CODE tags) from these commands, that will give us a start:-
Code:
uname -a
ps -f

When you log in (or start a new terminal) what gets displayed on your screen? Paste the screen text highlighting any errors into the thread, again in CODE tags or paste an image if you can do that.

I'm assuming that you run the script with the same account both from the command line and from cron, but please confirm the user(s) and their UID with id on the command line and pasting in the relevant line from crontab -l or copied from /etc/cron.d/whatever-you-called-it, or that could be /etc/cron.hourly/whatever or other variation, but I presume you know which one is is written in. It would be useful to know.

For differences between your login shell and the environment provided when cron runs something, can you do this:-
Code:
env>/tmp/login_env.txt
set>/tmp/login_set.txt

Then write yourself a small script containing:
Code:
env>/tmp/cron_env.txt
set>/tmp/cron_set.txt

.... and run it with cron, just the once will be fine, but don't use at because that will use your login shell environment too.

Did you take Corona688's suggestion to create ssh-keys in post 4? This would simplify your script somewhat.

Did you take Yoda's suggestion in post 6? Can you paste the error file it wrote? (in CODE tags) Perhaps run with and without the leading ~/.profile ; so we can see if the difference is useful.


If you answer the questions raised, then people will be happy to help, but without this information we're just guessing blind. We do not know what your server has set up.


I hope that this helps you help us to help you,
Robin

Last edited by rbatte1; 02-12-2018 at 01:40 PM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Crontab help

I have made changes to crontab using: crontab -e I then save them with :wq but the changes aren't being seen. The file mod date has not changed. What am I doing wrong? (2 Replies)
Discussion started by: ssmiths001
2 Replies

2. UNIX for Advanced & Expert Users

Crontab in HP-UX

Hello! I have a problem on adding a new crontab. Currently we have a running jobs scheduled on a crontab and they are all successfully running. However, when adding or inserting a new scheduled job, the script doesn't work. Is there any limitations on this? Please advise. Thank you very... (13 Replies)
Discussion started by: Tris
13 Replies

3. AIX

SFTP Failed---Request for subsystem 'sftp' failed on channel 0

Hi, While I am trying SFTP my machine to another unix machine , it was working fine till 10 min back. But now i am getting the below error "Request for subsystem 'sftp' failed on channel 0" Could you please someone help me to solve or analyise the root cause... Cheers:b:, Mahiban (0 Replies)
Discussion started by: mahiban
0 Replies

4. AIX

Crontab

How can i schedule a batch job/script to run every minute every day? Thanks (3 Replies)
Discussion started by: mrn6430
3 Replies

5. Shell Programming and Scripting

SFTP-how to log individual sftp command error while executing shell script

Hi, I have situation where i need to automate transferring 10000+ files using sftp. while read line do if ; then echo "-mput /home/student/Desktop/folder/$line/* /cygdrive/e/folder/$line/">>sftpCommand.txt fi done< files.txt sftp -b sftpCommand.txt stu@192.168.2.1 The above... (1 Reply)
Discussion started by: noobrobot
1 Replies

6. Programming

SFTP fails from crontab but works from terminal

Dear community, I'm driving crazy with a strange issue. I have a simple script to transfer a file to a remote system:#!/bin/bash echo "put /tmp/server.log" > /tmp/server1_transfer.sftp sftp -b /tmp/server1_transfer.sftp user@10.99.1.2:Between client and server there is a SSH KEY, so if I run... (15 Replies)
Discussion started by: Lord Spectre
15 Replies

7. Red Hat

Chroot sftp users, remote sftp login shows wrong timestamp on files

Hello, I have a weird issue, I have RHEL 5.7 running with openssh5.2 where sftpgroup OS group is chroot. I see the difference difference in timestamp on files, when I login via ssh and SFTP, I see four hour difference, is something missing in my configuration. #pwd... (8 Replies)
Discussion started by: bobby320
8 Replies

8. Shell Programming and Scripting

Sftp : not able to print the echo statements after the sftp transfer

I had the below sftp script working perfectly but the problem is I am not able to send the echo statements . #!/bin/sh echo "Starting to sftp..." sftp admin@myip << END_SCRIPT cd /remotepath/ lcd /localpath/ mget myfiles*.csv bye END_SCRIPT echo "Sftp successfully." echo echo... (11 Replies)
Discussion started by: scriptscript
11 Replies

9. Shell Programming and Scripting

Needed SFTP script from windows to UNIX server and from UNIX to windows server(reverse SFTP)

hi guys, i need a script to sftp the file from windows to unix server ....(before that i have to check whether the file exists in the windows server or not and again i have to reverse sftp the files from unix to windows server..... regards, Vasa Saikumar. (13 Replies)
Discussion started by: hemanthsaikumar
13 Replies

10. UNIX for Dummies Questions & Answers

Crontab

Hello, I have a situation with crontab command on AIX , when i run a script with crontab i receive empty output , when i run it manually i have information in it,beside the empty output ,SAS log is empty too, i don't know why isn't creating it , could someone told me how could verify crontab... (3 Replies)
Discussion started by: rimob
3 Replies
GAPPLETVIEWER(1)							GNU							  GAPPLETVIEWER(1)

NAME
gappletviewer - Load and runs an applet SYNOPSIS
appletviewer [OPTION]... URL... appletviewer [OPTION]... -code CODE appletviewer [OPTION]... -plugin INPUT,OUTPUT DESCRIPTION
The appletviewer tool loads and runs an applet. Use the first form to test applets specified by tag. The URL should resolve to an HTML document from which the appletviewer will extract applet tags. The APPLET, EMBED and OBJECT tags are supported. If a given document contains multiple applet tags, all the applets will be loaded, with each applet appearing in its own window. Likewise, when multiple URLs are specified, each applet tag instance is given its own window. If a given document contains no recognized tags the appletviewer does nothing. appletviewer http://www.gnu.org/software/classpath/ Use the second form to test an applet in development. This form allows applet tag attributes to be supplied on the command line. Only one applet may be specified using the -code option. The -code option overrides the URL form -- any URLs specified will be ignored. appletviewer -code Test.class -param datafile,data.txt gcjwebplugin uses the third form to communicate with the appletviewer through named pipes. OPTIONS
URL OPTIONS -debug This option is not yet implemented but is provided for compatibility. -encoding CHARSET Use this option to specify an alternate character encoding for the specified HTML page. APPLET TAG OPTIONS -code CODE Use the -code option to specify the value of the applet tag CODE attribute. -codebase CODEBASE Use the -codebase option to specify the value of the applet tag CODEBASE attribute. -archive ARCHIVE Use the -archive option to specify the value of the applet tag ARCHIVE attribute. -width WIDTH Use the -width option to specify the value of the applet tag WIDTH attribute. -height HEIGHT Use the -height option to specify the value of the applet tag HEIGHT attribute. -param NAME,VALUE Use the -param option to specify values for the NAME and VALUE attributes of an applet PARAM tag. PLUGIN OPTION -plugin INPUT,OUTPUT gcjwebplugin uses the -plugin option to specify the named pipe the appletviewer should use for receiving commands (INPUT) and the one it should use for sending commands to gcjwebplugin (OUTPUT). DEBUGGING OPTION -verbose Use the -verbose option to have the appletviewer print debugging messages. STANDARD OPTIONS -help Use the -help option to have the appletviewer print a usage message, then exit. -version Use the -version option to have the appletviewer print its version, then exit. -JOPTION Use the -J option to pass OPTION to the virtual machine that will run the appletviewer. Unlike other options, there must not be a space between the -J and OPTION. BUGS
SEE ALSO
AUTHOR
0.98 2010-07-05 GAPPLETVIEWER(1)
All times are GMT -4. The time now is 04:11 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy