LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 11-25-2008, 07:26 PM   #1
eddygrinder
Member
 
Registered: Dec 2007
Location: portugal
Distribution: The one and only... Slack
Posts: 71

Rep: Reputation: 15
rsync and hidden files


Hello!
When i do rsync -avz /source/ /dest it kept appearing a lot of hidden files like .abc.pdf.167RAI.

I delete them using: find /dir -name '.*' -type f -print0 | xargs -0 /bin/rm -f
And when i rsync again the damn files appears in my drive!

Is this normal?

Thx a lot
EddY
 
Old 11-25-2008, 08:47 PM   #2
rayfordj
Member
 
Registered: Feb 2008
Location: Texas
Distribution: Fedora, RHEL, CentOS
Posts: 488

Rep: Reputation: 78
Quote:
Originally Posted by eddygrinder View Post
Is this normal?
Yes.

man rsync
You may be interested in the filter or exclude options of rsync.
 
Old 07-09-2009, 02:22 PM   #3
xky
LQ Newbie
 
Registered: Jul 2009
Posts: 4

Rep: Reputation: 0
Quote:
Originally Posted by eddygrinder View Post
Hello!
When i do rsync -avz /source/ /dest it kept appearing a lot of hidden files like .abc.pdf.167RAI.

I delete them using: find /dir -name '.*' -type f -print0 | xargs -0 /bin/rm -f
And when i rsync again the damn files appears in my drive!

Is this normal?

Thx a lot
EddY
Hi, I've the same problem, but I can't find a right solution. I've read man pages, and I think that exclude option and filters can be useful only if hidden files ar present in source directory, The problem is that hidden files are generated by rsync

Thanks for help
 
Old 07-09-2009, 06:29 PM   #4
wadsworth
Member
 
Registered: Aug 2007
Distribution: Slackware64 13.37
Posts: 215

Rep: Reputation: 65
Hi,
rsync creates a temporary hidden file during a transfer,
but the file is renamed when the transfer is complete.

Common problem:
If you're syncing to or from FAT32 or NTFS,
you'll need to pass an extra switch to rsync; --modify-window=1
(disregard if FAT32/NTFS aren't involved)
 
Old 07-10-2009, 12:49 AM   #5
xky
LQ Newbie
 
Registered: Jul 2009
Posts: 4

Rep: Reputation: 0
Quote:
Originally Posted by wadsworth View Post
Hi,
rsync creates a temporary hidden file during a transfer,
but the file is renamed when the transfer is complete.

Common problem:
If you're syncing to or from FAT32 or NTFS,
you'll need to pass an extra switch to rsync; --modify-window=1
(disregard if FAT32/NTFS aren't involved)
thanks, I will try with this option
 
Old 07-10-2009, 05:07 AM   #6
xky
LQ Newbie
 
Registered: Jul 2009
Posts: 4

Rep: Reputation: 0
Quote:
Originally Posted by xky View Post
thanks, I will try with this option
nothing good!! I've tried with --modify-window=1 but the result is the same. I've seen that files generated in nas direcroty have a newer date, so the option -t don't preserve the original date
 
Old 07-10-2009, 07:16 AM   #7
gargamel
Senior Member
 
Registered: May 2003
Distribution: Slackware, OpenSuSE
Posts: 1,839

Rep: Reputation: 242Reputation: 242Reputation: 242
From the fact that you tried the modify-window switch I conclude that, at least, either source or target are using some kind of FAT/NTFS filesystem.

If it's NTFS, ok. But if it's FAT: This has driven me nuts in the past many times. Because it is impossible to preserve filemodes and such, when FAT is involved. Other metadata, like access times, may be lost, also, after the transfer. And what really sucks, is that filenames appear correctly spelled on the screen, but are actually converted to 8.3 length and capital letters. Finally, there's no support for international characters.
And, BTW, things get really obscure, if you transfer between a remote drive and local one. In such a situation you will find out, that even within a Microsoft-only environment things aren't handled correctly. Suddenly you'll see lots of Tilde characters (~) in truncated file names, and so on.

But these are all restrictions of FAT, not of rsync, and it's just a guess that your problem may have to do with one or some of them.

But maybe, you can provide a little more detail, so someone around here might be able to help better than I can.

gargamel
 
Old 07-10-2009, 11:50 AM   #8
eddygrinder
Member
 
Registered: Dec 2007
Location: portugal
Distribution: The one and only... Slack
Posts: 71

Original Poster
Rep: Reputation: 15
Hello!

I'm not an expert but i resolved my problem by creating two batch files:

1 - synchronize the tow directories: rsync -avz --exclude=".*" --no-group /home/grinder/escola/ /media/GRINDER/escola
2 - remove the hidden files: find /home/grinder/escola -name '.*' -type f -print0 | xargs -0 /bin/rm -f

The argument --exclude=".*" excludes the hidden files! So you don't have the hidden files synchronized

If you want to remove all hidden files created by rsync you can run 2

It may be the easiest way but it works...

I hope i could help...

cheers
 
Old 07-11-2009, 03:36 AM   #9
xky
LQ Newbie
 
Registered: Jul 2009
Posts: 4

Rep: Reputation: 0
for eddygrinder:

Hidden files are not present in my source directory, but only in destination directory.


for gargamel:

My destination folder is a NAS disk that can be formatted by web interface only in fat32. I note that files take date form NAS time server, so files get nas date. I solved this problem with two commands:
Code:
\cp -u -p -f -r -v /[source]/ /[destination]
with cp command "-u" I update files from source to destination without a phisical copy everytime, but just with a comparison.And "-p" option which preserve file date,owner and group.

Code:
rsync -a -h -v --delete-after /[source] /[destination]
After this, I execute rsync command because cp command don't remove files that has been removed by the user from source, rsync find out files with the same date of source files (thanks to cp -p) and only compare files and remove old files from destination

With this two operation I can simulate more or less a good rsync made with ntfs partition

Last edited by xky; 07-11-2009 at 03:41 AM.
 
Old 07-22-2009, 04:10 PM   #10
eddygrinder
Member
 
Registered: Dec 2007
Location: portugal
Distribution: The one and only... Slack
Posts: 71

Original Poster
Rep: Reputation: 15
Ok, my mistake!

In the beginning i remove the hidden files in both source and destination directories to have them free of hidden files!
After rsync i clean the destination dir with:
find /destination/directory -name '.*' -type f -print0 | xargs -0 /bin/rm -f

Sorry about that!

Cheers
EddY
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
rsync excluding hidden files? gonzojd7 Linux - Newbie 4 11-29-2018 09:02 AM
How do I make find exclude hidden files (.files) Rotwang Linux - General 2 08-08-2011 03:58 AM
rsync - How to Include Hidden (.something) Files and Directories? edwin11 Linux - Software 4 11-29-2006 07:47 AM
home directory files gone, hidden files remain Grasshopper Linux - Security 12 04-10-2005 08:23 PM
Hidden Files Alien18 Linux - Newbie 4 08-12-2004 09:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration