Đang Thực Hiện

116823 Server Backup Script

This is probably a PERL JOB, but if you want to propose it as PHP, please do and explain.


1. When script starts, get the current hour (1-24), day of week (MO, TU, WE, TH, FR, SA, SU), and day of month (1-31). For each record of the backup table (see below), if the current hour == hours field AND the current day of week OR day of month is within the days field, process that record (otherwise skip to next record). If processing:

1.1 ) Get source directory or file.

- Exclude sub-directories whose name matches any item in exclude_dirs.

- Exclude files within the source directory and it's sub-directories whose name matches any item in exclude_dirs.

- Exclude files within the source directory and it's sub-directories whose file extension matches any item in exclude_types.

1.2) Create a zip archive with yymmddhhmmss appended.

1.3) Put zip file in dest_local directory.

1.4) Put zip file in dest_remote server/directory using ssh (or specify another secure method).

1.5) Record backup date in last_day field, backup time in last_time field, outcome in last_outcome field (ok, remote error, etc.).

1.6) Append outcome to outcomes var (or temp file).

2) Once all records are done, if outcome var is not empty, send it in an emal.


source - full path

dest_local - full path

dest_remote - IP or FQDN of server, user, password, path

exclude_dirs - csv

exclude_files - csv

exclude_types - csv

hours - eg: 2,14 means at 2:00 and 14:00

days - MO, TU, WE, TH, FR, SA, SU, 1-31 - eg: MO, 2, 12 means Monday, the 2nd day of the month, and the 12th day of the month

last_day - date of last attempted processing

last_time - time of last attempted processing

last_outcome - outcome of last attempted processing


Minimum number of script files possible (config within script).

Speed is NOT important. Logical, easy to follow structure IS important. Comment extensively. Declare configuration variables early in script (emal address, SQL user, SQL pwd) and comment config in detail.

Linux server. Can add whatever Perl modules are needed. If PHP used, version 5. MySQL 4.



Kĩ năng: Bất kì công việc gì, MySQL, Perl

Xem nhiều hơn: temp work, sql get date, speed date script, script ip address, remote full time php, perl script to zip files, job matches, how to create a directory using php, sql server week number, sa password, mysql backup, linux ssh server, it su, backup job, speed extension, linux create zip file, backup sql mysql, php backup mysql, php backup, php add record mysql table, mysql php backup zip, mysql add record, mysql number sql, last days sql, mysql append

Về Bên Thuê:
( 4 nhận xét )

ID dự án: #1862990