Sponsored Content
Top Forums Shell Programming and Scripting Laptop/Desktop... Back up/Mirror script. Post 302177078 by Lakris on Thursday 20th of March 2008 01:31:50 AM
Old 03-20-2008
Good! For multiple patterns You use another --exclude, as in
Code:
rsync -av --exclude="Music" --exclude=Pics /home/<user> <user>@Laptop:/home

Btw, I just had to test it myselfSmilie and it works using exclude pattern with / (slash) in it and without quotes. You need it when pattern for example contains spaces:
Code:
lakris@ubuntu:~/projekt/scripts/synctest$ find .
.
./src
./src/checkdate.sh
./src/dellast.sh
./src/parse2.sh~
./src/dup-lines.txt
./src/quoted-text.sh~
./src/numberfiles
./src/numberfiles/678.txt
./src/numberfiles/456.txt
./src/numberfiles/586.txt
./src/file.txt
./src/Object4.txt
./src/filestuff
./src/filestuff/names
./src/filestuff/newnames
./src/filestuff/newnames/green
./src/filestuff/newnames/yellow
./src/filestuff/newnames/red
./src/filestuff/oldnames
./src/filestuff/oldnames/file_2
./src/filestuff/oldnames/file_1
./src/filestuff/oldnames/file_3
./src/Object1.txt
lakris@ubuntu:~/projekt/scripts/synctest$ rsync -av --exclude=src/filestuff/names --exclude=src/filestuff/oldnames src trg
building file list ... done
created directory trg
src/
src/Object1.txt
src/Object4.txt
src/checkdate.sh
src/dellast.sh
src/dup-lines.txt
src/file.txt
src/parse2.sh~
src/quoted-text.sh~
src/filestuff/
src/filestuff/newnames/
src/filestuff/newnames/green
src/filestuff/newnames/red
src/filestuff/newnames/yellow
src/numberfiles/
src/numberfiles/456.txt
src/numberfiles/586.txt
src/numberfiles/678.txt

sent 2285 bytes  received 352 bytes  5274.00 bytes/sec
total size is 1229  speedup is 0.47
lakris@ubuntu:~/projekt/scripts/synctest$ find trg
trg
trg/src
trg/src/checkdate.sh
trg/src/dellast.sh
trg/src/parse2.sh~
trg/src/dup-lines.txt
trg/src/quoted-text.sh~
trg/src/numberfiles
trg/src/numberfiles/678.txt
trg/src/numberfiles/456.txt
trg/src/numberfiles/586.txt
trg/src/file.txt
trg/src/Object4.txt
trg/src/filestuff
trg/src/filestuff/newnames
trg/src/filestuff/newnames/green
trg/src/filestuff/newnames/yellow
trg/src/filestuff/newnames/red
trg/src/Object1.txt
lakris@ubuntu:~/projekt/scripts/synctest$

 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Back-up/Mirror entire website

Hi all, I would like to backup the entire unix.com website in my system is it possible ?? i have hered about wget and curl will it possible to back up using wget ?? I have cygwin in window machine which have wget support . I don't know the syntax of doing the job. I am under a proxy... (2 Replies)
Discussion started by: jambesh
2 Replies

2. Debian

Laptop waking up in bag: go back to sleep script

I have a Debian-derived distro (Kubuntu 8.04) running on a Dell Inspiron laptop. This laptop often wakes from RAM suspension while in my bag. I would like to run a script, upon RAM suspension wake, that would detect if the lid switch is closed. If so, then the script should put the machine back in... (0 Replies)
Discussion started by: dotancohen
0 Replies

3. Solaris

ZFS Mirror versus Hardware Mirror

I've looked a little but haven't found a solid answer, assuming there is one. What's better, hardware mirroring or ZFS mirroring? Common practice for us was to use the raid controllers on the Sun x86 servers. Now we've been using ZFS mirroring since U6. Any performance difference? Any other... (3 Replies)
Discussion started by: Lespaul20
3 Replies

4. Solaris

What is mirror and sub mirror in RAID -1 SVM

Hi , I am new to SVM .when i try to learn RAID 1 , first they are creating two RAID 0 strips through metainit d51 1 1 c0t0d0s2 metainit d52 1 1 c1t0d0s2 In the next step metainit d50 -m d51 d50: Mirror is setup next step is metaattach d50 d52 d50 : submirror d52 is... (7 Replies)
Discussion started by: vr_mari
7 Replies

5. Ubuntu

Connect 2 laptops with RJ45 cable (Ubuntu 10.10 laptop with Windows 7 laptop)

Hi to all, I have the problem that a laptops with windows XP cannot startup even in safe mode nor using last good known configuration. I have a Ubuntu 10.10 Live CD and booting from it I can read the Hard Drive. I need to do a backup the Hard Drive from XP laptop and I want to connect this... (5 Replies)
Discussion started by: cgkmal
5 Replies

6. Hardware

Connect SATA Laptop HardDrive to Desktop SATA Slots

Hello everybody, I need to connect a laptop 2.5 SATA hard drive to a Desktop board (which uses 3.5' SATA hard drives). I've tried the connectors and they fit excellent in the 2.5 SATA connectors. The problem is that the laptop hard drive uses 5v and the PC's power source sends 12v. So, my... (4 Replies)
Discussion started by: Zykl0n-B
4 Replies

7. HP-UX

What is the difference between DRD and Root Mirror Disk using LVM mirror ?

what is the difference between DRD and Root Mirror Disk using LVM mirror ? (3 Replies)
Discussion started by: maxim42
3 Replies

8. Ubuntu

Laptop to laptop transfer files

Dear all, I would like to transfer my old laptop documents/files etc to the new laptop without using any external hard disk. Please let me know if its possible via any way. Thank in advance, emily (3 Replies)
Discussion started by: emily
3 Replies

9. UNIX for Beginners Questions & Answers

Spooling File to My Desktop From Back-end using shell script

Hello all, I am trying to spool a SQL query output file from back-end to desktop in a certain path but it didn't work,the query writes the output in a file in the same directory at the back-end. note : i use the same query in sql developper and file was created in the desired path fine code... (1 Reply)
Discussion started by: bmaksoud
1 Replies
LAPTOP_MODE(8)						      System Manager's Manual						    LAPTOP_MODE(8)

NAME
/usr/sbin/laptop_mode - apply laptop mode settings SYNOPSIS
/usr/sbin/laptop_mode [ cmd ] [ force ] DESCRIPTION
This manual page documents briefly the /usr/sbin/laptop_mode command. laptop_mode is a program that applies the settings given in the /etc/laptop-mode/laptop-mode.conf configuration file. The primary use is to control the laptop mode feature included in Linux kernels with versions 2.6.6 and higher, and 2.4.23 and higher. This feature increases battery life by letting your hard drive spin down. This is achieved by grouping disk write activity into "chunks" that are spaced at larger intervals than they normally would be. In addition to sup- porting the Linux kernel's laptop mode feature, /usr/sbin/laptop_mode also supports various power saving modules which are configured through configuration files in the /etc/laptop-mode/conf.d directory. It is not recommended to call /usr/sbin/laptop_mode directly to start or stop laptop mode, except in hardware event handlers. To apply new configuration settings from laptop-mode.conf, call the laptop-mode service init script with the reload parameter. COMMANDS
Specify force as the second parameter to force laptop_mode to re-apply a state even if the computer is already in that state. These are the values that are allowed for cmd : auto Enable or disable laptop mode based on the current power state. Note that this will not do anything if the laptop-mode service has not been started! status Display a status report about everything that laptop_mode affects. SEE ALSO
laptop-mode.conf(8). AUTHOR
This manual page was written by Bart Samwel (bart@samwel.tk) for the Debian system (but may be used by others). Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 any later version published by the Free Software Foundation. On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL. LAPTOP_MODE(8)
All times are GMT -4. The time now is 06:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy