Sponsored Content
Top Forums Shell Programming and Scripting Rsync - how to copy hidden folder or hidden files when using full path Post 303004792 by jcdole on Monday 9th of October 2017 07:12:03 AM
Old 10-09-2017
Quote:
Originally Posted by Chubler_XL
rsync has no concept of hidden files and processes both files identically for me.

See my testing transcript below where both files copied OK:

Code:
$ A_FULL_PATH_D="home/install_user/.some_dir/some_file"
$ A_FULL_PATH_S="backup_sys/¬001_INSTALL/¬100_ETC_and_USER_MODIFIED_FILES/2017_10_06_22h30/${A_FULL_PATH_D}"
$ mkdir -p $(dirname $A_FULL_PATH_D $A_FULL_PATH_S)
$ touch $A_FULL_PATH_S
$ rsync -av --include=".*" "$A_FULL_PATH_S"  "$A_FULL_PATH_D"
sending incremental file list
some_file

sent 112 bytes  received 35 bytes  294.00 bytes/sec
total size is 0  speedup is 0.00
 
$ A_FULL_PATH_D="home/install_user/.some_dir/.some_file"
$ A_FULL_PATH_S="backup_sys/¬001_INSTALL/¬100_ETC_and_USER_MODIFIED_FILES/2017_10_06_22h30/${A_FULL_PATH_D}"
$ touch $A_FULL_PATH_S
$ rsync -av --include=".*" "$A_FULL_PATH_S"  "$A_FULL_PATH_D"
sending incremental file list
.some_file

sent 113 bytes  received 35 bytes  296.00 bytes/sec
total size is 0  speedup is 0.00

$ find $(dirname $A_FULL_PATH_D) -type f -print
home/install_user/.some_dir/.some_file
home/install_user/.some_dir/some_file

There were a typo error in my definition of the destination path.

Any way thank you very much for taking time to help me.
 

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

recursive copy of hidden files

I need to know how to copy hidden files recursively? cp -r sourceDir/* targetDir/. ignores the hidden files. Thank you!! (2 Replies)
Discussion started by: usfrog
2 Replies

2. UNIX for Dummies Questions & Answers

how to copy hidden files from one folder to another

dear all, i want to copy all files in my home dir to another. from my home dir i have given ls -la then some hidden files are there with dot . .. and i also want to copy all dirs in my home as it is . because iam upgrading the system how to copy all files and dirs in my home dir... (1 Reply)
Discussion started by: rajan_ka1
1 Replies

3. Shell Programming and Scripting

Finding Hidden files and protecting the folder containing hidden files from deletion

Hi. I have a script which is deleting files with a particular extension and older than 45 days.The code is: find <path> -name "<filename_pattern>" -mtime +45 -exec rm {} \; But the problem is that some important files are also getting deleted.To prevent this I have decide to make a dummy... (4 Replies)
Discussion started by: pochaw
4 Replies

4. UNIX for Advanced & Expert Users

How to rsync or tar directory trees, with hidden directory, but without files?

I want to backup all the directory tress, including hidden directories, without copying any files. find . -type d gives the perfect list. When I tried tar, it won't work for me because it tars all the files. find . -type d | xargs tar -cvf a.tar So i tried rsync. On my own test box, the... (4 Replies)
Discussion started by: fld2007
4 Replies

5. UNIX for Dummies Questions & Answers

hidden files

I usually use ls -al | awk '{sum = sum + $5} END {print sum}' to sum the size of all files in a directory. However this command includes the hidden files. Is there a command to just add up all the files/sub-directories excluding the hidden files (begins with . and ..) I wanted to check the... (10 Replies)
Discussion started by: lhareigh890
10 Replies

6. Shell Programming and Scripting

Not visible hidden folder

Hi, In one folder there is a hidden folder. Whenever i do any ls -a i can't see the folder. However i can get into the folder by cd .foldername. Would you please help me to identify what is the problem here. (13 Replies)
Discussion started by: anupdas
13 Replies

7. UNIX for Dummies Questions & Answers

List all directories hidden or not hidden

I want to list all directories hidden or not hidden. ls -ld */ => shows only not hidden directories so i guess the answer would be to add the a option to show all files ls -lad */ => not working :confused: ls -la | grep "^d" => works But I would like to know why I can't use ls -lad... (4 Replies)
Discussion started by: servus
4 Replies

8. 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

9. AIX

Copy to Windows hidden share

Hi, I need to find a solution for backing up/transferring BACKUP (dump file) from AIX (specifically) to Windows 2012 Hidden Share. The vendor says that he cannot do a copy from his system to hidden share because it requires a password... Personally, I think that there should be a solution... (9 Replies)
Discussion started by: pob579
9 Replies
Perl::Critic::Policy::InputOutput::ProhibitBarewordFileHUsereContributed Perl DocPerl::Critic::Policy::InputOutput::ProhibitBarewordFileHandles(3)

NAME
Perl::Critic::Policy::InputOutput::ProhibitBarewordFileHandles - Write "open my $fh, q{<}, $filename;" instead of "open FH, q{<}, $filename;". AFFILIATION
This Policy is part of the core Perl::Critic distribution. DESCRIPTION
Using bareword symbols to refer to file handles is particularly evil because they are global, and you have no idea if that symbol already points to some other file handle. You can mitigate some of that risk by "local"izing the symbol first, but that's pretty ugly. Since Perl 5.6, you can use an undefined scalar variable as a lexical reference to an anonymous filehandle. Alternatively, see the IO::Handle or IO::File or FileHandle modules for an object-oriented approach. open FH, '<', $some_file; #not ok open my $fh, '<', $some_file; #ok my $fh = IO::File->new($some_file); #ok There are three exceptions: STDIN, STDOUT and STDERR. These three standard filehandles are always package variables. CONFIGURATION
This Policy is not configurable except for the standard options. SEE ALSO
IO::Handle IO::File AUTHOR
Jeffrey Ryan Thalhammer <jeff@imaginative-software.com> COPYRIGHT
Copyright (c) 2005-2011 Imaginative Software Systems. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.16.3 2014-06-09 Perl::Critic::Policy::InputOutput::ProhibitBarewordFileHandles(3)
All times are GMT -4. The time now is 01:44 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy