FTP files modified after a particular date between servers
Hi all,
i need to write a shell script to transfer a file modified after a particular date from one server to another. I searched for the related posts in this forum and got hints and snippets for it. i tried the below code
This is what i tried. The files are in server A and i am running this script file from server B so tat it will connect to server A and retrieve the files to server B. When i executed the script, i got the error as "Invalid Command" in my log. I am not sure where the error is in the code.
I tried the code changes suggested by you. This time around i am not getting any invalid command error in my log but am not able to transfer files modified after a date.In the log , am not able to get the text "Port command successful". In the find command this is how i gave the source dir path.
My files will be in the z folder in the remote server. I am not sure whether it is able to identify the source dir in the remote server. My script file will be in server B and the files to be copied in server A. I am running this script in server B which will connect to A and transfer the files. Kindly suggest a solution.
@methyl
I am trying to connect to 2 unix servers and copy files from a folder in one server to a folder in the other server. I have only read-only permissions in the server from where the files to be transferred are there. In the other server i have full access.
Sorry My post was completely useless because you're getting files, not putting them.
I'm not sure how you could do that with just ftp, except, perhaps if you had a file on the remote server with the list of files to transfer, then you could first transfer that file, and use it as a basis for transferring the other files.
I did a quick test (albeit using SFTP as I don't have - or want FTP):
If you need the PATHS locally too, you would need some extra work.
Otherwise, the scp route is maybe the best option.
I don't have the name of the files to transfer from remote server. I need to get those files which were modified after a particular date. I tried using the ssh command. I tried connecting to the remote server using the ssh command to copy files modified after a date from that server to my current server.
This is what i tried:
The modified file names are getting printed in the screen from the echo cmd. But while transferring the files using scp cmd, it gives an error that it is not able to identify the target path. Is there a solution to it?
Can someone draw up a script that for every file, folder and subfolder and files that will copy the creation date over top of the modified date??
I know how to touch every file recursively, but no idea how to read a files creation date then use that to touch the modification date of that file,... (3 Replies)
Hi there!
I was wondering if someone could help me with the following:
I'm trying to find all files within a directory which have been modified since midnight of the current date.
Any help would be appreciated.
Thank you kindly. (6 Replies)
Hi,
i need to put files with current date at end from one server to another.
i.e. all the output files from below comand.
ls -ltr `date '+monthly_stats.sh%y%m%d'`
am using
mput `date '+monthly_stats.sh%y%m%d'`
but no files are transfered
Connected to gbdsnh18.hartfordlife.com.
220... (5 Replies)
Hi All,
Can you please help me to get only the files which has the modified date as yesterday and before?
Thanks in advance!
Regards,
Velava.S (4 Replies)
Actually i did modification in a file on server by mistake, now its showing current time stamp, is there any way to set the files modified date and stamp to last modifies time.
Please advice here.Thanks in advance.:b: (7 Replies)
Hi all,
I'm using Red Hat Linux and want to move some folders and files around but not change the modified date. Is this possible?
I know cp has a -p flag which seems to do what I want, but this is a large volume of data so copying and deleting would not be feasible. (13 Replies)
Hi
How to list all the files in a directory that are modified on a particular date?
Also need to know the count,i.e number of files modified on a particular date.
Thanks
Ashok (1 Reply)
Hello all - I've looked and have not been able to find a "find" command that will list the last modified date of files within a specific directory and its subdirectories. If anyone knows of such a command it would be very much appreciated!
If possible, I would like to sort this output and have... (5 Replies)
Hello Mates! I'm kinda new to unix and need to a solve a problem.
Input: date
Situation: With the given date I need to find a list of all such files starting from a given path that were modified after the given date.
I experimented with the "find" with "-newer" but did not quite get it... (4 Replies)
HI,
I have some files in my Linux machine that are very old and occupy a HUGe amount of space. I am trying to delete these files from the system so that it will be easy for me to add some files. I would like to know if this can done through a Perl or a shell script.
What i want to do is i... (6 Replies)