You are not logged in.

#1 2014-06-12 17:17:23

nstgc
Member
Registered: 2014-03-17
Posts: 350

[solved] rsync not copying hidden files

The issue is that rsync isn't copying hidden files. I'm using the switches -aAXh, and excluding nothing. I checked the man pages to ensure that none of those were in conflict, and they aren't. I also searched Google, which returned results indicating that I should be using the "a" switch and to make sure I'm not excluding anything, neither of which is the case. I then tried to troubleshoot with a friend of mine who is a Linux system's admin (whom actually suggested yesterday I use rsync in place of Areca yesterday), but the problem remains.

The command I'm running is in a short script

#!/bin/bash

DEST=/run/media/nstgc/bckup/nstgc
DATE=$(date +%m-%d-%y)
OPTS="-aAXh --stats --progress"

rsync $OPTS /btrfs/raid1/snapshots/1/nstgc.snap_$DATE/* /$DEST/
rsync $OPTS /btrfs/raid1/snapshots/1/pix.snap_$DATE/* /$DEST/Pictures/
rsync $OPTS /btrfs/raid1/snapshots/1/music.snap_$DATE/* /$DEST/Music/
rsync $OPTS /btrfs/jabod/snapshots/1/dl.snap_$DATE/* /$DEST/Downloads/

which is run after another short script

#!/bin/bash

DATE=$(date +%m-%d-%y)
R1=/btrfs/raid1
RS1=/btrfs/raid1/snapshots
AR=/btrfs/aroot/
ARS=/btrfs/aroot/snapshots
JD=/btrfs/jabod
JDS=btrfs/jabod/snapshots

btrfs sub del $RS1/9/*
btrfs sub del $ARS/9/*
btrfs sub del $JDS/9/*

for X in {8..1}; do mv $RS1/$X/* $RS1/$(($X+1))/; done
for X in {8..1}; do mv $ARS/$X/* $ARS/$(($X+1))/; done
for X in {8..1}; do mv $JDS/$X/* $JDS/$(($X+1))/; done

btrfs sub snap $AR/arch $AR/snapshots/1/arch.snap_$DATE
btrfs sub snap $R1/nstgc $RS1/1/nstgc.snap_$DATE
btrfs sub snap $R1/pix $RS1/1/pix.snap_$DATE
btrfs sub snap $R1/videos $RS1/1/videos.snap_$DATE
btrfs sub snap $R1/music $RS1/1/music.snap_$DATE
btrfs sub snap $JD/dl $JD/snapshots/1/dl.snap_$DATE

That last script runs fine as far as I can see.

[edit]

The solution was to get rid of the asterisks as ukhippo suggested. I still have other issues with rsync, but I'm working through those.

ukhippo wrote:

You're explicitly specifying the files to copy on your rsync commands. “*” does not match hidden files.
However, if you want to copy everything just specify the directory as the source (i.e. remove the *, but keep the trailing /)

Last edited by nstgc (2014-06-12 22:59:55)

Offline

#2 2014-06-12 17:41:05

ukhippo
Member
From: Non-paged pool
Registered: 2014-02-21
Posts: 274

Re: [solved] rsync not copying hidden files

You're explicitly specifying the files to copy on your rsync commands. “*” does not match hidden files.
However, if you want to copy everything just specify the directory as the source (i.e. remove the *, but keep the trailing /)

Offline

#3 2014-06-12 20:00:43

ninian
Member
From: United Kingdom
Registered: 2008-02-24
Posts: 694
Website

Re: [solved] rsync not copying hidden files

ukhippo wrote:

You're explicitly specifying the files to copy on your rsync commands. “*” does not match hidden files.
However, if you want to copy everything just specify the directory as the source (i.e. remove the *, but keep the trailing /)

Hah! I got caught a few weeks ago with that very problem - when cloning a whole system, alas.
Wondered where the ~/.config stuff (among other hidden configuration files) had gone.
Have learned that lesson the hard way!

Offline

#4 2014-06-12 23:00:17

nstgc
Member
Registered: 2014-03-17
Posts: 350

Re: [solved] rsync not copying hidden files

ukhippo wrote:

You're explicitly specifying the files to copy on your rsync commands. “*” does not match hidden files.
However, if you want to copy everything just specify the directory as the source (i.e. remove the *, but keep the trailing /)

That was it. Thank you.

Offline

Board footer

Powered by FluxBB