Preserve destination timestamp while copying


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Preserve destination timestamp while copying
# 8  
Old 09-07-2017
Quote:
Originally Posted by rohit_shinez
problem here is i dont have permission to do touch -r or touch -md as suggested bt rbatte1
If you don't have permissions to set the timestamp, any method you find to accomplish this without getting those permissions will be -- by definition! -- a security exploit. Not going to happen. You'll have to just ask.

What are the exact owners and permissions of the folder? What user / group are you? This will narrow down exactly what you need to ask for.
# 9  
Old 09-07-2017
Do you need to keep the source file and its meta data?
If not,
Code:
touch -r dest-file src-file
cp src-file dest-file

# 10  
Old 09-07-2017
create a tar file and restore it in the new directory.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Grep lines between last hour timestamp and current timestamp

So basically I have a log file and each line in this log file starts with a timestamp: MON DD HH:MM:SS SEP 15 07:30:01 I need to grep all the lines between last hour timestamp and current timestamp. Then these lines will be moved to a tmp file from which I will grep for particular strings. ... (1 Reply)
Discussion started by: nms
1 Replies

2. Shell Programming and Scripting

AIX : Need to convert UNIX Timestamp to normal timestamp

Hello , I am working on AIX. I have to convert Unix timestamp to normal timestamp. Below is the file. The Unix timestamp will always be preceded by EFFECTIVE_TIME as first field as shown and there could be multiple EFFECTIVE_TIME in the file : 3.txt Contents of... (6 Replies)
Discussion started by: rahul2662
6 Replies

3. Shell Programming and Scripting

How to preserve time stamp while copying a directory from Server B to Server A?

Experts, Please help me out here. How to preserve time stamp while copying a directory from Server B to Server A (3 Replies)
Discussion started by: ahmed.vaghar
3 Replies

4. Shell Programming and Scripting

To check timestamp in logfile and display lines upto 3 hours before current timestamp

Hi Friends, I have the following logfile. Currently time in india is 07/31/2014 12:33:34 and i have the following content in logfile. I want to display only those entries which contain string 'Exception' within last 3 hours. In this case, it would be the last line only I can get the... (12 Replies)
Discussion started by: srkmish
12 Replies

5. UNIX for Dummies Questions & Answers

How to compare a file by its timestamp and store in a different location whenever timestamp changes?

Hi All, I am new to unix programming. I am trying for a requirement and the requirement goes like this..... I have a test folder. Which tracks log files. After certain time, the log file is getting overwritten by another file (randomly as the time interval is not periodic). I need to preserve... (2 Replies)
Discussion started by: mailsara
2 Replies

6. Shell Programming and Scripting

Timestamp copying giving file path and name as inputs

PLAESE CHECK WHETHER THIS SCRIPT WORKS OR NOT. THIS IS MY FIRST SCRIPT, HELP ME out if any ERRORS are present. a=0; while do echo "ENTER path" read path if then echo "path found" cd $path DateTimeStamp=$(date '+%d_%m_%y_%H_%M') echo "enter file name" read file (2 Replies)
Discussion started by: arunreddy01
2 Replies

7. UNIX for Advanced & Expert Users

How to copy a file from remote server and preserve timestamp

Hi How to copy a file from remote server and preserve timestamp. Please not, i have to pass username and password to connect to the remote server in the shell script. Can this be achieved with simple ftp ? are there any options in ftp ? Thanks (4 Replies)
Discussion started by: skumar75
4 Replies

8. UNIX for Advanced & Expert Users

Automated SCP script passing password to preserve source file timestamp

Hi My requirement is i want to copy files from remote server to the local server and also i need to preserve the timestamp of the remote file. By using scp -p , it is working fine in the interactive call but it is not preserving he file timestamp when i use it in the non interactive scp call... (1 Reply)
Discussion started by: skumar75
1 Replies

9. Shell Programming and Scripting

Copying files with increment in destination

Hi.. i have a source and destination directories & want to copy files from source to destination those files are unique to source directory . And those files are common to both the directory copy source to destination with a numeric increment as extension. If in the destination there are more... (2 Replies)
Discussion started by: posix
2 Replies

10. Shell Programming and Scripting

preserve timestamp of symlinks using rsync

Hi, In my shell programming, When i copy sym links from one server to another server using rsync it does not preserve time stamp . it showing current time after copying in destination server.the command i used is rsync -vaR -- How can i preserve sym links time stamp using rsync. Thanx (1 Reply)
Discussion started by: KiranKumarKarre
1 Replies
Login or Register to Ask a Question