Sponsored Content
Top Forums Shell Programming and Scripting rename files in remote server via ftp Post 302150933 by porter on Thursday 13th of December 2007 04:05:07 AM
Old 12-13-2007
Yes, rename one file at a time.

You can't really have a wild card for the target unless you want the rename to replace an existing file.

Also, any expansion of the wildcard would give multiple arguments, and rename can only really deal with two.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

FTP multiple files from remote server to local server

Hi, I am facing a weired problem in my FTP script. I want to transfer multiple files from remote server to local server everyday, using mget * in my script. I also, want to send an email for successful or failed FTP. My script works for file transfer, but it don't send any mail. There is... (2 Replies)
Discussion started by: berlin_germany
2 Replies

2. UNIX for Dummies Questions & Answers

Can I copy files on remote server with ftp ?

I just realize the only way is to download and upload again.. is not possible to copy them remotely with the ftp protocol ? thanks (2 Replies)
Discussion started by: aneuryzma
2 Replies

3. Shell Programming and Scripting

preserving the timestamp of a file when copied from remote server to local server using ftp

Hi, I need to copy few files from remote server to local server. I write a shell script to connect to the remote server using ftp and go to that path. Now i need to copy those files in the remote directory to my local server with the timestamp of all those files shouldnt be changed. ... (5 Replies)
Discussion started by: arunkumarmc
5 Replies

4. HP-UX

[Solved] Unable to rename file in ftp server .Net:FTP perl

Hello All, I am trying to connect to ftp server and get the files. Also i need to rename the file in other ftp dir. rename method is not allowing me to rename the file in other dir. When i tried copy command by using net::FTP:FILE then perl says it is not installed. Can some body help me to... (2 Replies)
Discussion started by: krsnadasa
2 Replies

5. Shell Programming and Scripting

ftp'ing multiple files to the remote server

unix shell script (2 Replies)
Discussion started by: giridhar276
2 Replies

6. Shell Programming and Scripting

FTP files from different directory from remote server to one directory in local

Hi All, I want to search for .log files from folders and sub folders in remote server and FTP them to one particular folder in the local machine. I dont want to copy the entire directory tree structure, just have to take all the .log files from all the folders by doing a recursive search from the... (3 Replies)
Discussion started by: dassv
3 Replies

7. Shell Programming and Scripting

Copy down remote files and rename them to include the server name with full path

I need to pull down a good bit of files for another support team for an upgrade project. I have a server.list with all of the server names. I need to do two parts: FIRST: I have this example, but it does not list the server name in front of each line. #! /bin/bash for server in $(<... (10 Replies)
Discussion started by: asnatlas
10 Replies

8. Shell Programming and Scripting

Rename Files in remote directory

Hi All, I am creating a script which will connect to remote server with ssh and perfom below. - Search in a directory - Search for a pattern - Check the size if greater than the size_limit rename the file. Below is the code i have written. ssh user@host <<EOF find /tmp... (5 Replies)
Discussion started by: Girish19
5 Replies

9. Shell Programming and Scripting

Script connect to remote server, not find files and exit only from remote server, but not from scrip

I have a script, which connecting to remote server and first checks, if the files are there by timestamp. If not I want the script exit without error. Below is a code TARFILE=${NAME}.tar TARGZFILE=${NAME}.tar.gz ssh ${DESTSERVNAME} 'cd /export/home/iciprod/download/let/monthly;... (3 Replies)
Discussion started by: digioleg54
3 Replies

10. Shell Programming and Scripting

Rename (move) multiple files on remote server using sftp

I want to rename (move) multiple files on remote server. I tried the following command to move all TXT files from my_dir directory to /new_dir. But it does not work. Any help? #!/bin/ksh sftp -dev3 << ABC cd my_dir $(for i in TXT; do echo "ls *.$i" ; rename $x /new_dir/$x;... (1 Reply)
Discussion started by: Soham
1 Replies
rename(2)							System Calls Manual							 rename(2)

NAME
rename - change the name of a file SYNOPSIS
DESCRIPTION
The system call causes the source file to be renamed to target. If target exists, it is first removed. Both source and target must be of the same type (that is, either directories or nondirectories), and must reside on the same file system. If target can be created or if it existed before the call, guarantees that an instance of target will exist, even if the system crashes in the midst of the operation. If the final component of source is a symbolic link, the symbolic link is renamed, not the file or directory to which the symbolic link points. RETURN VALUE
returns the following values: Successful completion. Failure. Neither file is affected. is set to indicate the error. ERRORS
If fails, is set to one of the following values. [EACCES] A component of either path prefix denies search permission. [EACCES] The requested link requires writing to a directory without write permission. [EBUSY] target or source is an existing directory that is the mount point for a mounted file system. [EDQUOT] User's disk quota block or inode limit has been reached for this file system. [EEXIST] target is a directory and is not empty. [EFAULT] source or target points outside the allocated address space of the process. Reliable detection of this error is implementation dependent. [EINVAL] source is a parent directory of target, or an attempt is made to rename the or directory. [EISDIR] target is a directory, but source is not. [ELOOP] Too many symbolic links were encountered in translating either path name. [ENAMETOOLONG] A component of either path name exceeds bytes while is in effect, or the entire length of either path name exceeds bytes. [ENOENT] A component of the source path does not exist, or a path prefix of target does not exist. [ENOSPC] The destination directory cannot be extended because of a lack of space on the file system containing the directory. [ENOTDIR] A component of either path prefix is not a directory. [ENOTDIR] source is a directory, but target is not. [EPERM] The directory containing source has the sticky bit set, and neither the containing directory nor the source are owned by the effective user ID. [EPERM] The target file exists, the directory containing target has the sticky bit set, and neither the containing directory nor the target are owned by the effective user ID. [EROFS] The requested link requires writing in a directory on a read-only file system. [EXDEV] The paths named by source and target are on different logical devices (file systems). AUTHOR
was developed by the University of California, Berkeley. SEE ALSO
open(2). STANDARDS CONFORMANCE
rename(2)
All times are GMT -4. The time now is 08:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy