initial commit
This commit is contained in:
75
app/Console/Documentation/Archive.txt
Normal file
75
app/Console/Documentation/Archive.txt
Normal file
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
List of Archive Commands
|
||||
* Command:
|
||||
* php app\Console\cake.php Backup initiateArchive <months> <limit>
|
||||
*
|
||||
* Description:
|
||||
=======================================================
|
||||
1. Get data from the "backup_expenses" table in the current database.
|
||||
2. Save the data to the "expenses" table in the archive database(another database).
|
||||
Steps
|
||||
======
|
||||
1. Go to Project Folder
|
||||
2. Run the command like
|
||||
In Widows:
|
||||
C:\xampp_php7\htdocs\expensecount> C:\xampp_php7\php\php.exe app\Console\cake.php Backup initiateArchive 50 100
|
||||
(project dir)> "PHP executable" "Entry Point CakePHP shells" "Shell Class" "Function" "Months" "Rows"
|
||||
( it means
|
||||
1. 50 month before data from current month
|
||||
2. 100 record at a time
|
||||
)
|
||||
*===========================================================
|
||||
* Parameters:
|
||||
* <months> Number of months before the current date. Records older than
|
||||
* this period will be moved to the archive database.
|
||||
* <limit> Maximum number of records to archive in a single execution.
|
||||
*
|
||||
* Example:
|
||||
* Console/cake Backup initiateArchive 100 100
|
||||
*
|
||||
* This command archives up to 100 records that are older than
|
||||
* 10 months from the current date.
|
||||
*
|
||||
* Usage Notes:
|
||||
* - Suitable for scheduled execution via cron or manual maintenance tasks.
|
||||
* - Ensure backup processes are functioning correctly before execution.
|
||||
*/
|
||||
|
||||
/*
|
||||
Single Archive Commands
|
||||
|
||||
* Command:
|
||||
* php app\Console\cake.php Backup archieveSingleItem <unique_url>
|
||||
*
|
||||
* Description:
|
||||
===================
|
||||
1. Get data from the "backup_expenses" table by unique_url in the current database.
|
||||
2. Save the data to the "expenses" table in the archive database(another database).
|
||||
Steps
|
||||
======
|
||||
1. Go to Project Folder
|
||||
2. Run the command like
|
||||
In Widows:
|
||||
C:\xampp_php7\htdocs\expensecount> C:\xampp_php7\php\php.exe app\Console\cake.php Backup archieveSingleItem 1ILcOUb0fe3JpgB
|
||||
(project dir)> "PHP executable" "Entry Point CakePHP shells" "Shell Class" "Function" "unique_url"
|
||||
( it means
|
||||
1. Archive data by unique_url 1ILcOUb0fe3JpgB
|
||||
)
|
||||
*
|
||||
* Parameters:
|
||||
* <unique_url> The unique identifier of the expense to be archived.
|
||||
*
|
||||
* Usage:
|
||||
* Run this command to archive one specific expense on demand.
|
||||
* Example:
|
||||
* php app\Console\cake.php Backup archieveSingleItem 1ILcOUb0fe3JpgB
|
||||
*
|
||||
* Purpose:
|
||||
* - Supports manual or targeted archival of individual expense records.
|
||||
* - Helps keep backup and live databases lightweight.
|
||||
*
|
||||
* Notes:
|
||||
* - Ensure the expense exists in the backup tables before running the command.
|
||||
|
||||
|
||||
*/
|
||||
36
app/Console/Documentation/ArchiveDelete.txt
Normal file
36
app/Console/Documentation/ArchiveDelete.txt
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Command:
|
||||
* php app\Console\cake.php Backup initiateRemoveArchive <months> <limit>
|
||||
*
|
||||
* Description:
|
||||
=======================================================
|
||||
1. Get the data to the "expenses" table in the archive database.
|
||||
2. Removed from respective tables in archive tables
|
||||
Steps
|
||||
======
|
||||
1. Go to Project Folder
|
||||
2. Run the command like
|
||||
In Widows:
|
||||
C:\xampp_php7\htdocs\expensecount> C:\xampp_php7\php\php.exe app\Console\cake.php Backup initiateRemoveArchive 50 100
|
||||
(project dir)> "PHP executable" "Entry Point CakePHP shells" "Shell Class" "Function" "Months" "Rows"
|
||||
( it means
|
||||
1. 50 month before data from current month
|
||||
2. 100 record at a time
|
||||
)
|
||||
*===========================================================
|
||||
*
|
||||
* Parameters:
|
||||
* <months> Number of months before the current date. Records older than
|
||||
* this period will be permanently removed.
|
||||
* <limit> Maximum number of records to remove in a single execution.
|
||||
*
|
||||
* Example:
|
||||
* php app\Console\cake.php Backup initiateRemoveArchive 10 100
|
||||
*
|
||||
* This command deletes up to 100 archived records that are older than
|
||||
* 10 months from the current date.
|
||||
*
|
||||
* Usage Notes:
|
||||
* - Intended to be run via cron or manually as part of archive maintenance.
|
||||
|
||||
*/
|
||||
106
app/Console/Documentation/Backup.txt
Normal file
106
app/Console/Documentation/Backup.txt
Normal file
@@ -0,0 +1,106 @@
|
||||
/*
|
||||
Generate Access Info
|
||||
* Command:
|
||||
* Console/cake Backup generateAccessInfo
|
||||
*
|
||||
* Description:
|
||||
* Generates access information for expense records created before
|
||||
* 25 February 2018. This prepares historical records for further
|
||||
* backup and archival processing.
|
||||
*
|
||||
* Execution Frequency:
|
||||
* Run **only once**.
|
||||
*
|
||||
* Purpose:
|
||||
* - Prepares old expense records for backup and archival.
|
||||
* - Ensures access information is available for subsequent backup commands.
|
||||
*
|
||||
* Usage Notes:
|
||||
* - Intended for one-time execution during initial setup.
|
||||
* - Verify database connectivity before running the command.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
Shift Expired Records
|
||||
* Command:
|
||||
* Console/cake Backup shiftExpiredRecords <month>
|
||||
*
|
||||
* Description:
|
||||
* Identifies expired records and moves them into the `expired_records` table.
|
||||
* After shifting, all corresponding records are deleted from the `access_info` table.
|
||||
*
|
||||
* Execution Frequency:
|
||||
* Recommended to run once every hour.
|
||||
*
|
||||
* Purpose:
|
||||
* - Prepares expired records for backup processing.
|
||||
* - Keeps the `access_info` table clean and up-to-date.
|
||||
*
|
||||
* Usage:
|
||||
* Run this command to backup a specific expense on demand.
|
||||
* Example:
|
||||
* Console/cake Backup shiftExpiredRecords 4
|
||||
* Usage Notes:
|
||||
* - Suitable for scheduled execution via cron.
|
||||
* - Ensure database connectivity before running this command.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
Bulk Expense Backup
|
||||
* Command:
|
||||
* Console/cake Backup initiateBackup <limit>
|
||||
*
|
||||
* Description:
|
||||
* Scans the `expired_records` table and moves the records into the backup tables.
|
||||
* After successfully taking the backup, the records are deleted from the `expired_records` table.
|
||||
*
|
||||
* Execution Frequency:
|
||||
* Recommended to run once every six hours.
|
||||
*
|
||||
* Purpose:
|
||||
* - Transfers expired records from live tables to backup tables.
|
||||
* - Keeps the `expired_records` table from growing indefinitely.
|
||||
*
|
||||
* Usage:
|
||||
* Run this command to backup a specific expense on demand.
|
||||
* Example:
|
||||
* Console/cake Backup initiateBackup 100
|
||||
*
|
||||
* Usage Notes:
|
||||
* - Suitable for scheduled execution via cron.
|
||||
* - Ensure database backups are functioning correctly before running this command.
|
||||
* - Recommended to run during low-traffic periods to minimize load.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
Single Expense Backup
|
||||
* Command:
|
||||
* Console/cake Backup backupSingleExpense <unique_url>
|
||||
*
|
||||
* Description:
|
||||
* Backs up a single expense record from the live tables to the backup tables
|
||||
* in the production database. This is useful for manually backing up
|
||||
* individual records without running bulk backup operations.
|
||||
*
|
||||
* Parameters:
|
||||
* <unique_url> The unique identifier of the expense to be backed up.
|
||||
*
|
||||
* Usage:
|
||||
* Run this command to backup a specific expense on demand.
|
||||
* Example:
|
||||
* Console/cake Backup backupSingleExpense 1ILcOUb0fe3JpgB
|
||||
*
|
||||
* Purpose:
|
||||
* - Supports targeted backup of individual expense records.
|
||||
* - Helps ensure important records are safely copied to backup tables.
|
||||
*
|
||||
* Notes:
|
||||
* - Ensure the record exists in the live tables before running the command.
|
||||
|
||||
*/
|
||||
Reference in New Issue
Block a user