이 장치가 연결되면 하드 드라이브의 특정 디렉토리에서 USB 메모리 장치의 특정 디렉토리로 모든 파일을 복사하는 솔루션을 찾고 있습니다.
팟 캐스트 에피소드를 다운로드하는 프로그램이 있습니다.
이 파일들을 컴퓨터에 연결하면 자동으로 mp3 플레이어로 이동 (또는 최소한 복사)하고 싶습니다.
나는 Windows XP와 Linux 컴퓨터를 모두 가지고 있으므로 그중 하나에 대한 해결책이 나를 위해 일할 것입니다.
Autorun.inf 및 .bat 파일을 사용하여 Windows 용 자체 솔루션을 쉽게 구축 할 수 있습니다.
Bat 파일을 만들어 디렉토리를 USB 드라이브에 복사하십시오.
xcopy /e /y c:\podcasts\*.* .\dir_on_usb_drive
박쥐 파일을 mp3 플레이어에 놓고 이러한 지침 를 사용하여 autorun.inf를 만듭니다.
이제 문제에 대한 자체 빌드 솔루션이 있어야하지만 미리 만들어진 솔루션이있을 수 있습니다. :)
Linux의 경우 :
약간의 Python 스크립팅을 신경 쓰지 않으면 이벤트를 위해 HAL을 수신하고 선택한 장치가 연결되면 스크립트를 시작하는 데몬을 작성할 수 있습니다. 예제 스크립트는 this 처럼 보입니다 :
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
import dbus
import dbus.service
if getattr(dbus, 'version', (0,0,0)) >= (0,41,0):
import dbus.glib
import gobject
import sys
import os
class DeviceManager:
def __init__(self):
self.bus = dbus.SystemBus()
self.bus.add_signal_receiver(self.device_added,
'DeviceAdded',
'org.freedesktop.Hal.Manager',
'org.freedesktop.Hal',
'/org/freedesktop/Hal/Manager')
self.bus.add_signal_receiver(self.device_removed,
'DeviceRemoved',
'org.freedesktop.Hal.Manager',
'org.freedesktop.Hal',
'/org/freedesktop/Hal/Manager')
def udi_to_device(self, udi):
return self.bus.get_object("org.freedesktop.Hal", udi)
def device_added(self, udi):
print 'Added', udi
properties = self.udi_to_device(udi).GetAllProperties()
if properties.get('info.category') == u'volume':
label, dev = properties.get('volume.label'), properties.get('block.device')
print 'Mounting %s on /media/%s' %(dev, label)
os.system('pmount %s /media/%s' %(dev, label))
def device_removed(self, udi):
print 'Removed', udi
if __name__ == '__main__':
m = DeviceManager()
mainloop = gobject.MainLoop()
try:
mainloop.run()
except KeyboardInterrupt:
mainloop.quit()
print 'Exiting...'
sys.exit(0)
device_added()
함수를 수정하여 특정 장치로 제한하고 os.system()
호출을 사용자 지정 스크립트로 바꾸면됩니다.
드라이브로 제한하기 위해 volume.uuid
속성을 사용할 수 있으며 사용 가능한 속성의 전체 목록을 hal-device
프로그램으로 표시 할 수 있습니다.
부팅시 데몬을 시작하려면 /etc/rc.local
에서 시작하십시오.
삽입시 Windows 7 및 플래시/USB 장치에 자동 동기화!
SyncToy 다운로드 폴더 페어링 및 동기화 이름 설정 ( "SyncTest")
방법 : SyncToy를 사용하여 야간 내 문서 미러 만들기
작업 스케줄러에서 작업을 바로 실행하여 작동하는지 확인할 수 있습니다. 이제 배터리로 랩톱을 실행하는 다른 문제는 조건 탭의 작업 관리자에서 "컴퓨터가 AC 전원에 연결된 경우에만 작업 시작"을 선택 취소하십시오. 그렇지 않으면 AC가 연결되어있을 때만 작업이 실행됩니다.
또한 USB 폴링 및 연결 끊기/다시 연결로 인해이 작업은 몇 분마다 실행되며 실제로는 시원합니다. 항상 USB HDD와 자동 동기화됩니다. :)
편집 : SyncBack SE에 트리거 동작이 있음이 밝혀졌습니다.
프로필을 열고“때”탭으로 이동 한 다음“삽입”으로 이동하십시오. 드라이브 문자, 레이블 또는 일련 번호로 지정할 수 있습니다.
그러나 SE 버전은 무료가 아니며 Windows 만 (제 생각에)
또는 TweakUI를 사용하여 자동 실행 이벤트 동기화 프로그램의 경우 (SyncToy의 예)를 추가 할 수 있습니다.
적용을 클릭하십시오.
이제 펜 드라이브를 연결하십시오.
USB 장치를 연결할 때 자동으로 시작되는 다른 프로그램을 찾지 못하는 것 같습니다.
그들은 모두 동기화를 시작하는 일정에 의존합니다. USB 장치가 연결되어 있지 않으면 실행되지 않으면 실패 할 것입니다.
그러나 동기화 버튼을 클릭하기 만하면 USB 장치를 수동으로 연결해야하는 것이 더 쉬울 것입니다.
어쨌든 나는 또한 Linux와 Windows에서 실행되는 동기화 도구를 찾았습니다. DirSync Pro 완전히 무료이며 Java에서 실행되며 Nice GUI가 있습니다.
* Synchronization
o Powerful synchronization algorithm.
o Bidirectional (Two way) and Unidirectional (One way) synchronization mode.
o Option for various behavior of conflict resolution for Bidirectional Synchronization.
o Synchronizes unlimited number of folders.
o Large number of options to change the synchronization behavior.
o Option to synchonise subdirectories recursively.
o Synchronizes files/folders any file system (FAT, FAT16, FAT32, NTFS, WinFS, UDF, Ext2, Ext3, ...).
o Synchronizes files from/to network drives
o Synchronizes files from/to any mounted devices (Harddisks, USB-Sticks, Memory cards, External drives, CD/DVD's, ...).
o Synchronization could be used for making incremental backups.
o Option to create up to 50 backups from the modified/changed files before synchronization.
o Option to define a backup folder.
o Option for handling symbolic links.
o Option for handling time-stamps.
* General
o Easy, clear and user-friendly graphical user interface, no unnecessary gadget you never use.
o Runs on every modern operating system including Windows™, Linux™ and Macintosh™
o It is Portable! It does not need any installation. Just run the application!
o Open source, it is 100% free of charge, 100% free of commercial text, 100% free of advertisements and 100% free of spyware.
o No time/function limitations
o Uses no local database, so no overhead
o Does not need any installation. Just download and run it. You can put it on you USB-stick en you can run it on any computer/any platform.
* Logging
o Advanced logging/reporting facilities. Just select a log level and define where to write the log.
o Option to log on application level (default log)
o Option to log on each directory level (dir log)
o Option to define the log leven (how much to log)
키 폴더를 동기화하기 위해 몇 가지 배치와 함께 AUTORUN.INF를 사용합니다. 매우 간단하고 매우 효과적입니다.
또한 읽기 전용 인 경우 아카이브 된 autorun.inf 파일에 하드 계약 USB 스틱 바이러스가 있습니다.
Linux에서는 프로그램을 지속적으로 실행하여 이벤트를 수신하는 대신 이미 실행중인 프로그램을 사용할 수 있습니다. 장치를 임시 위치에 마운트 한 다음 rsync를 시작하여 여러 디렉토리를 동기화하는 후크를 udev에 추가 할 수 있습니다.
그런데 장치 서명에 따라 특정 작업을 정의 할 수 있습니다. 특정 키를 삽입하면 작업 문서를 동기화하거나 USB 대용량 저장 장치 MP3 플레이어를 삽입하면 음악을 저장하거나 Kindle을 연결할 때 책을 동기화합니다.
Raspbian Wheezy에서 실행되는 Raspberry Pi로 작은 감시 시스템을 설정할 때 IP 카메라로 업로드 한 FTP 폴더에서 모든 파일을 지속적으로 이동해야했습니다. 그래서 홈 디렉토리 (~)에 스크립트를 작성하고 cron으로 1 분에 한 번 호출했습니다.
crontab -e
*/1 * * * * Sudo ~/move_images_to_usb
move_images_to_usb는 일반적인 bash 스크립트입니다 .bash에서 스크립트를 작성하지는 않았지만 ...
#!/bin/bash
if df | grep "sda1"
then
mkdir /media/usb0/ipcam1
cp -r /var/ftp /media/usb0/ipcam1
rm /var/ftp/*
fi
USB 드라이브를 삽입하면 이름이 sda1 (다른 드라이브는 sdb1이되므로 작동하지 않음)
당신은 단순히 ""
그리고 끝 ".\dectory\"
← 끝 \
슬래시도.
원래 배치 수식이 작동합니다. 지금은 며칠이 지났으며 디렉토리, 배치 파일 및 명령 프롬프트에 많은 공간이 있습니다.
내 모습 :
xcopy "F:\Web Stuff\Web Dev\Dev_FactorY Designs\*.*" ".\HTML_PROJ\Web Stuff\Web Dev\Dev_FactorY Designs\" /e /y
Steven의 방법을 시도했지만 USB 이벤트가 "이벤트 뷰어/Windows 로그/시스템"에 표시되지 않았습니다 (Windows 7을 사용하고 있습니다). 나는 조금 둘러보고 USB 삽입 이벤트가 "이벤트 뷰어/응용 프로그램 및 서비스 로그/Microsoft/Windows/DriverFrameworks-UserMode/Operational"에 있습니다. 먼저 로그를 지우고 (원하는 이벤트를 쉽게 찾을 수 있도록) USB 플래시 드라이브를 삽입하십시오. 로그를 새로 고치면 많은 이벤트가 나타납니다. 가장 많은 이벤트 (즉, 가장 최근의 이벤트)를 선택하고 해당 작업을 할당했습니다 (이벤트 설명에 삽입 한 특정 USB 드라이브에 특정한 것이 있는지 확인하십시오).
무료 SyncBack 프로그램을 사용하여 실제 동기화를 수행했습니다. 잘 작동합니다!
이것은 오래된 실이지만, 나는 그것을 원하는 사람을 위해 이것을 여기에 pu 할 것이라고 생각했습니다. 필요에 따라 관련 정보를 변경하면 모든 것이 가능해집니다. 이것을 처음 반복 한 https://superuser.com/users/232313/tyler .
@echo off
cls
echo waiting
goto check
Change the STUFF TO COPY location to the folder that you want
everything inside to be send to the usb's, and change the 3 instances of
G: to whatever drive letter that the USB uses.
Good Luck!
:start
set choice=
robocopy "C:\STUFFTOCOPY" "G:" /E
echo Waiting for removal
goto wait
:check
timeout /t 1 /nobreak >nul
if exist "G:" (goto start) else goto check
:wait
timeout /t 1 /nobreak >nul
if exist "G:" (goto wait) else (
echo removed
echo waiting
goto check
)
Karenware의 Replicator 프로그램을 사용합니다. 그녀는 Windows를위한 작은 유용한 프로그램을 많이 작성했습니다 (W98/W2K/XP 초기의 PowerToys를 생각하십시오).
여기 링크가 있습니다. http://www.karenware.com/powertools/ptreplicator.asp
야간 일정으로 설정하십시오. USB 드라이브가 연결되어 있으면 다운로드 폴더를 USB 내용과 동기화합니다.
무료입니다!