Sponsored Content
Top Forums Shell Programming and Scripting lftp script to connect to external sftp site and download to internal ftp and then send email Post 302717125 by DGPickett on Wednesday 17th of October 2012 02:57:05 PM
Old 10-17-2012
How many hosts are we talking about? Sftp from A /somewhere to local B /somewhere2 then ftp from local B /somewhere2 to ftp C /somewhere3, and cp to share locally mounted /somewhere4.

Also, you need to verify you got a good copy, as you are destroying the original. You can get a length from ls. You can dlowload twice. Better if you signall they can remove it later by moving/renaming it somewhere else on that server (preferably on same device, so not a copying operation).

sftp reads /dev/tty for passwords, so PPK would be a lot easier than sftp under 'expect' or 'ssh -tt' or something to capture a fake tty you can write a password to, plus it is bad security to have passwords kicking around.

Making a file list with ls under sftp and keeping it to drive email is pretty simple.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

need script to connect sftp servers

Dear friends, i need to connect sftp server from my home directory using script . Please can anyone help me on this. (1 Reply)
Discussion started by: kittusri9
1 Replies

2. Shell Programming and Scripting

script for download files from ftp site

I'm new to scripting. I'm trying to write a script to download files from ftp site, the following is the script and the message i get after running the script. no files were downloaded :( Thanks advance! script: #!/usr/bin/ksh DAY=`date --date="-1 days" +%y%m%d` ftp -v -n "ftp.address" <<... (5 Replies)
Discussion started by: tiff-matt
5 Replies

3. Linux

shell script to download files from a site?

Hey everyone, my wife has purchased a bundle package of a bunch of images from a site, and now has to download each one of them manually. There are about 500 downloads, and it's quite a hassle to browse to each page and download them all individually. I would like to write a shell script to... (2 Replies)
Discussion started by: paqman
2 Replies

4. Shell Programming and Scripting

LFTP - to download files that are between 0 and 3 days old

Im writing a script and i specifically need it to download files that are between 0-2 days old. This will run every 2 days. I understand lftp supports newer files only, but these files will be removed from the target so this is not what we want. Does anyone know how to do this? ----------... (0 Replies)
Discussion started by: mokachoka
0 Replies

5. UNIX for Advanced & Expert Users

lftp: Option to lftp a file, wait and download a file as soon as its created

Please let me know what is lftp options combination to wait and download a file from target as soon as its gets created. I tried with different options but not able to get it working as I need any help would be appreciated (4 Replies)
Discussion started by: bmkux
4 Replies

6. Shell Programming and Scripting

Script to send email after comparing the folder permissions to a certain permission & send email

Hello , I am trying to write a unix shell script to compare folder permission to say drwxr-x-wx and then send an email to my id in case the folders don't have the drwxr-x-wx permissions set for them . I have been trying to come up with a script for few days now , pls help me:( (2 Replies)
Discussion started by: nairshar
2 Replies

7. Red Hat

Disk in Linux machine are internal or external

How to check whether the disk in linux machine are internal or external ( from nas or san). How to identify internal(local) and external disks. Following are some details of my server. Thanks. #df -h Filesystem Size Used Avail Use% Mounted on /dev/sda3 15G 3.5G 10G... (2 Replies)
Discussion started by: salmanraza
2 Replies

8. Cybersecurity

When i start CSF i cant connect VPS or download any data into it It appears i cant connect Linux VP?

It appears i cant connect linux VPS server via SSH or i cant SCP any file to it and i cant wget any file TO it (from inside it) while CSF (Config Server Firewall, LFD is running. Just after isntall in default configuration and after changing TESTING mode to LIVE mode. Trying to wget & install... (1 Reply)
Discussion started by: postcd
1 Replies

9. Shell Programming and Scripting

Lftp sftp get - script renames the local file with suffix tilde

Hi, Below script used for sftp get, #/bin/bash USER=xxx PASS=xxx HOST=xxx REMOTE_FILE=$1 LOCAL_FILE_LOC=$2 cd $LOCAL_FILE_LOC lftp sftp://$USER:$PASS@$HOST:10022 -e "get $REMOTE_FILE; bye" If file does not exist in sftp server, and file (same as remote file name) exists in local dir,... (4 Replies)
Discussion started by: vhegde1011
4 Replies
uudemon(4)						     Kernel Interfaces Manual							uudemon(4)

NAME
uudemon.admin, uudemon.cleanu, uudemon.hour, uudemon.poll - Administrative shell scripts for polling remote systems, cleaning up spool directories, reporting status to the system administrator, and routine invocations of the uuxqt and uusched daemons SYNOPSIS
These shell scripts reside in the following directory: /usr/lib/uucp DESCRIPTION
All the scripts can be run from the command line or can be run automatically by the cron daemon. To automatically run the scripts, remove the comment character (#) from the beginning of the relevant line in the /var/spool/cron/crontabs/uucp file. This script reports status to the system administrator. It issues the uustat command to find out the status of uucp jobs. It mails the results to the uucp login ID. The script may be modified to send mail to any login ID such as the uucp administrative login ID (uucpa) or root. This script cleans up the /var/spool/uucp and /var/spool/uucppublic directories by running the uucleanup command. The uucleanup com- mand is run with the following parameters: -C7, -D7, X2, -o2, -W1. This script runs the uusched and uuxqt daemons in the background. This script polls the systems listed in the /usr/lib/uucp/Poll file. The uudemon.poll script should be scheduled before the uudemon.hour script. This allows uudemon.poll to create any command files before cron runs the uudemon.hour script. FILES
Contains the uudemon.admin, uudemon.cleanu, uudemon.hour and uudemon.poll files. Contains the uucp file. RELATED INFORMATION
Commands: cron(8), uucleanup(8), uusched(8), uuxqt(1) Files: /usr/lib/uucp delim off uudemon(4)
All times are GMT -4. The time now is 04:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy