-
Notifications
You must be signed in to change notification settings - Fork 5
/
sync-home
executable file
·114 lines (104 loc) · 1.32 KB
/
sync-home
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#!/usr/bin/perl
use strict;
use warnings;
my $host = `n9`;
chomp $host;
my $dir = "$ENV{HOME}/Code/n9";
my $myDocsLocal = "$dir/backup/backup-home";
my $myDocsRemote = "/home/user";
my $local = $myDocsLocal;
my $remote = "user\@$host:$myDocsRemote";
my @excludes = qw(
mms-pix
openvpn
pixmirror
revtun-port
to-do-o
xbestddr
xgnuplotddr
.0dcim-pix-rev
.brightness
.emumaster
.FBReader
.bash_history
.gntpositions
.gnupg
.gpg
.klomp
.lftp
.lpsmagic
.mozilla
.mplayer
.purple
.secrets
.sqlite_history
.ssh
.status-menu
.stellarium-n9
.twip
.vim
.viminfo
.vimrc
MyDocs
private
.accounts
.aegis
.ash_history
.bashrc
.cache
.calendar
.cities
.commhistoryd
.config
.contacts
.cpan/
.emoticonthemecache
.emoticonthemepreview
.facebook
.fontconfig
.gntrc
.grob
.gstreamer-0.10
.kde
.local
.meego-im-engines
.messaging-ui
.mms
.mtp
.mtpdeviceinfo.xml
.nfc/
.obex-root
.odnp
.odnp-fpcd
.omb
.osso-cud-scripts
.positioningd
.profile
.profiled
.pulse-cookie
.qmf
.ring-tones
.rtcom-accounts
.signon
.slpgwd
.smartsearch
.swype
.sync
.thumbnails
.transferui
.usetime
);
my @rsyncOpts = qw(
-a --no-owner --no-group
-v -P
);
for my $exclude(@excludes){
push @rsyncOpts, "--exclude=$exclude";
}
sub run(@){
print "@_\n";
system @_;
die "failed" if $? != 0;
}
run "rsync", @rsyncOpts, "$remote/", $local;
run "rsync", @rsyncOpts, "$local/", $remote;