Sponsored Content
Full Discussion: find, remove, and ftp......
Top Forums UNIX for Dummies Questions & Answers find, remove, and ftp...... Post 23504 by peter.herlihy on Monday 24th of June 2002 08:22:16 PM
Old 06-24-2002
find, remove, and ftp......

I have a script that is run each night by cron. This script generates an extract then places it into an 'extracts' folder and also ftp's a copy to another server.

I have set up the script to remove any files in the extracts folder greater than 28 days old (this occurs each time the script is run). This is the command.

find ${WORKdir}/extracts/ -mtime +29 -exec rm {} \; &&

Now I also want this function to occur in the folder on the other server - preferably using ftp. Here is the ftp activity I already have.

if [ -s ${EXTfile} ]
then
ftp -n ${FTPserver} << cmd
user ${FTPid} ${FTPpwd}
cd ${FTPlocation}
lcd ${WORKdir}/extracts
put ${SHORTfile}
quit
cmd
fi

Can FTP do anything like this - by using unix commands somehow?

Last edited by peter.herlihy; 06-25-2002 at 12:29 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Find and Remove help needed!!!!

thank you for the help. (1 Reply)
Discussion started by: scooter17
1 Replies

2. UNIX for Dummies Questions & Answers

FIND and REMOVE HELP NEEDED!!!

Hello, I am aware of that Find command finds certain files and remove command removes certain files. However, is there a way to Find certain DIRECTORY and remove that DIRECTORY? thank you (3 Replies)
Discussion started by: scooter17
3 Replies

3. UNIX for Dummies Questions & Answers

Find and remove command - can you tell me exactly what its doing?

find /app01/tomcat_local -name *jsp* -type f -exec rm -r {} \; I would assume the above is just deleting any *jsp* below the /app01/tomcat_local directory - is this correct as its seems to delete more than I expect.... (1 Reply)
Discussion started by: frustrated1
1 Replies

4. UNIX for Advanced & Expert Users

Using FTP to check whether file is completely FTP... plz find the description below

Hi, We have some clients who will place huge files in to one of the remote server. And the shell script written in our local server to retrieve client files (using FTP) placed on one of the remote server of ours by clients. My question Is there any FTP command/script to check from my local... (1 Reply)
Discussion started by: nmsrao
1 Replies

5. Shell Programming and Scripting

To remove multiple files in FTP

We have a files in FTP server..... after getting the files from FTP by mget *.* i hav to remove all files (multiple files) at once... is there any command to delete multiple files at once (2 Replies)
Discussion started by: nani1984
2 Replies

6. Shell Programming and Scripting

find regex and remove #

hi , how do i remove # from a line where i found regex.. don't need to remove all the line.. only remove comment.. (3 Replies)
Discussion started by: Poki
3 Replies

7. Shell Programming and Scripting

Remove files using FTP

I am trying to remove files using FTP and used the commaned delete *.* mdelete *.* to remove the files. I am receiving an error. what is the command to delete all the files in the directory through FTP (2 Replies)
Discussion started by: bond2222
2 Replies

8. Shell Programming and Scripting

Find and Remove

I am trying to get multiple strings removed or replaced with space in a file, for individual strings I have been using the following and it works sed -e 's/#*#*//g' test_1.dat > test_2.dat what needs to be done if multiple strings are to be removed? For example I will need to remove the... (3 Replies)
Discussion started by: btt3165
3 Replies

9. Shell Programming and Scripting

Remove ./ from result when i do find

Hi All, When i do find command i am getting result which append ./ before the file name. For example if i am trying to search aaa.txt in current directory i am using find like this: $ find . -name aaa.txt result: ./aaa.txt Now i want to remove "./" from the file name. Can some body... (5 Replies)
Discussion started by: VasuKukkapalli
5 Replies

10. UNIX for Beginners Questions & Answers

Bash to remove find and remove specific extension

The bash below executes and does find all the .bam files in each R_2019 folder. However set -x shows that the .bam extension only gets removed from one .bam file in each folder (appears to be the last in each). Why is it not removing the extension from each (this is $SAMPLE)? Thank you :). set... (4 Replies)
Discussion started by: cmccabe
4 Replies
ftp(4)								   File Formats 							    ftp(4)

NAME
ftp - FTP client configuration file SYNOPSIS
/etc/default/ftp DESCRIPTION
Use the ftp file to configure the behavior of the FTP client. Lines that begin with a hash symbol ("# ") are treated as comment lines and are ignored. Behavior Directives The ftp file supports the following behavior directives: FTP_LS_SENDS_NLST=yes | no The ls command of the ftp client sends an NLST to the FTP Server by default. Several non-Solaris clients send LIST instead. In order to make the Solaris ftp client send LIST when the ls command is issued, set FTP_LS_SENDS_NLST to no. The value of FTP_LS_SENDS_NLST is yes by default. If the user sets a value for FTP_LS_SENDS_NLST in the user's environment, this value will override any FTP_LS_SENDS_NLST directive that is specified in /etc/default/ftp. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWbipr | +-----------------------------+-----------------------------+ SEE ALSO
ftp(1), attributes(5) SunOS 5.10 22 Oct 2002 ftp(4)
All times are GMT -4. The time now is 11:48 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy