BAT for rsync clients to perform synchronous operations
Copy Code code as follows:
@echo off
RSYNC-ZTRUVOGLP--progress--password-file=jb51.secrets/cygdrive/g/wwwroot/jb51/jb51@114.80.*.*::jb51
rsync server-side configuration
Rsyncd.conf
Copy Code code as follows:
Use Chroot = False
Strict modes = False
Hosts allow = *
Log file = Rsyncd.log
PID file = Rsyncd.pid
# Module Definitions
# Remember Cygwin naming conventions:c:\work becomes/cygwin/c/work
#
[Bigdown]
Path =/cygdrive/f/webroot/bigdown
Read Only = False
Transfer logging = yes
Auto USER=WTJB51
Secrets file=wtjb51.conf
wtjb51.conf (available on client server side)
Server-side is the root directory, the client is the bin directory, everyone more testing, if the hint password is wrong may be the path problem
Copy Code code as follows:
rsync Guard Process Bat
Can prevent the engine room suddenly power off, cause the rsync service cannot open
Copy Code code as follows:
@echo off
for/f "Usebackq"%%i in (' "Tasklist|find/c" Cygrunsrv.exe "") Does (
Set chkstat=%%i
)
If%chkstat% = 0 (
Del "D:\Program Files\cwrsyncserver\rsyncd.pid"/F
net start Rsyncserver
echo ================ >>%date:~0,10%.log
echo%date%%time% Check rsync service Stop >> Rsync%date:~0,10%.log
echo Restart Rsync service! >>%date:~0,10%.log
echo ================ >>%date:~0,10%.log
)
Serv_u Guard Process (for Serv_u frequently stop problem) bat
Copy Code code as follows:
@echo off
for/f "Usebackq"%%i in (' "Tasklist|find/c" ServUDaemon.exe "") Does (
Set chkstat=%%i
)
If%chkstat% = 0 (
net start Serv-u
echo ================ >>%date:~0,10%.log
echo%date%%time% Check serv-u service Stop >>%date:~0,10%.log
echo Restart Serv-u service! >>%date:~0,10%.log
echo ================ >>%date:~0,10%.log
)
SQL Server timed reboot bat
Copy Code code as follows:
Echo y net stop SQLServerAgent
echo y net stop mssqlserver
NET start MSSQLServer
Net start SQLServerAgent
SQL Server compressed log
You can make jb51.ldf files very small, make it easy to back up databases, and so on, and execute them in SQL Server Query Analyzer.
Copy Code code as follows:
DUMP TRANSACTION [jb51] with no_log
BACKUP LOG [jb51] with no_log
DBCC shrinkdatabase ([jb51])
Server reboot If you are using the Rsync server, in order not to allow Rsync servers to start
You can use the following bat
Copy Code code as follows:
net stop Rsyncserver
SHUTDOWN/R/F
or install the directory on the rsync server
Copy Code code as follows:
Del Rsyncd.pid
C:\WINDOWS\SYSTEM32\SHUTDOWN.EXE/R/F
Cloud Habitat Community Original article