excluding hidden files only in a particular directory

Clash Royale CLAN TAG#URR8PPP up vote
1
down vote
favorite
IâÂÂm trying to synchronise my home folder with a usb disk.
I would like to ignore the hidden files and directory in my home folder but only in this directory, I still need to synchronise the hidden files in the sub-directories contained in my home folder.
I tried to use this optionâ¯: --exclude="/home/valentin/.*" --exclude "/home/valentin/.*/" but rsync synchronises everything, even /home/valentin/.cache/ for example
What option do I need to use�
rsync
add a comment |Â
up vote
1
down vote
favorite
IâÂÂm trying to synchronise my home folder with a usb disk.
I would like to ignore the hidden files and directory in my home folder but only in this directory, I still need to synchronise the hidden files in the sub-directories contained in my home folder.
I tried to use this optionâ¯: --exclude="/home/valentin/.*" --exclude "/home/valentin/.*/" but rsync synchronises everything, even /home/valentin/.cache/ for example
What option do I need to use�
rsync
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
IâÂÂm trying to synchronise my home folder with a usb disk.
I would like to ignore the hidden files and directory in my home folder but only in this directory, I still need to synchronise the hidden files in the sub-directories contained in my home folder.
I tried to use this optionâ¯: --exclude="/home/valentin/.*" --exclude "/home/valentin/.*/" but rsync synchronises everything, even /home/valentin/.cache/ for example
What option do I need to use�
rsync
IâÂÂm trying to synchronise my home folder with a usb disk.
I would like to ignore the hidden files and directory in my home folder but only in this directory, I still need to synchronise the hidden files in the sub-directories contained in my home folder.
I tried to use this optionâ¯: --exclude="/home/valentin/.*" --exclude "/home/valentin/.*/" but rsync synchronises everything, even /home/valentin/.cache/ for example
What option do I need to use�
rsync
rsync
asked Mar 21 at 16:13
Albizia
437
437
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
2
down vote
accepted
Use below command.
rsync -avz --exclude '/.*' /home/valentin/ /destination_folder
add a comment |Â
up vote
0
down vote
The path rsync uses for --exclude is relative to the /source
rsync -avz --exclude '.*' ~ /destination
should do the trick.
This will exclude all hidden files
â dedunumax
Mar 21 at 17:05
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
Use below command.
rsync -avz --exclude '/.*' /home/valentin/ /destination_folder
add a comment |Â
up vote
2
down vote
accepted
Use below command.
rsync -avz --exclude '/.*' /home/valentin/ /destination_folder
add a comment |Â
up vote
2
down vote
accepted
up vote
2
down vote
accepted
Use below command.
rsync -avz --exclude '/.*' /home/valentin/ /destination_folder
Use below command.
rsync -avz --exclude '/.*' /home/valentin/ /destination_folder
answered Mar 21 at 17:04
dedunumax
4,26021526
4,26021526
add a comment |Â
add a comment |Â
up vote
0
down vote
The path rsync uses for --exclude is relative to the /source
rsync -avz --exclude '.*' ~ /destination
should do the trick.
This will exclude all hidden files
â dedunumax
Mar 21 at 17:05
add a comment |Â
up vote
0
down vote
The path rsync uses for --exclude is relative to the /source
rsync -avz --exclude '.*' ~ /destination
should do the trick.
This will exclude all hidden files
â dedunumax
Mar 21 at 17:05
add a comment |Â
up vote
0
down vote
up vote
0
down vote
The path rsync uses for --exclude is relative to the /source
rsync -avz --exclude '.*' ~ /destination
should do the trick.
The path rsync uses for --exclude is relative to the /source
rsync -avz --exclude '.*' ~ /destination
should do the trick.
answered Mar 21 at 16:44
variona
1149
1149
This will exclude all hidden files
â dedunumax
Mar 21 at 17:05
add a comment |Â
This will exclude all hidden files
â dedunumax
Mar 21 at 17:05
This will exclude all hidden files
â dedunumax
Mar 21 at 17:05
This will exclude all hidden files
â dedunumax
Mar 21 at 17:05
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1017991%2fexcluding-hidden-files-only-in-a-particular-directory%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password