This script is designed to help you take backups of specific folders. To specify the folders and their backup configurations, follow these instructions.
<folder-name>;<nocode/nodb/skip>;<lando>
field1 = folder-name - name of the folder you want to back up
field2 = nocode/nodb/skip (optional), you can leave the field blank or just give "skip" for readability
field3 = lando (optional), only if its a lando project
- Create a
.backup
file: In your HOME directory, create a file named.backup
. This file will contain a list of folders and their backup configurations.
- Specify the folders: List the names of the folders you want to back up, with each folder name on a separate line. For example:
folder1
folder2
This will back up "folder1" and "folder2" by default (both code and database).
- Customize backup configurations: You can customize the backup configurations for each folder by adding optional flags after the folder name.
-
To skip code backup for a folder, add
;nocode
after the folder name. For example:folder1;nocode
-
To skip database backup for a folder, add
;nodb
after the folder name. For example:folder1;nodb
-
For Lando projects, to take database backups, you can add
;lando
after adding skip after folder name. For Example:folder1;skip;lando
The
lando
flag is used to indicate that the project is a Lando project, the "skip" flag is used to avoid applying the "nocode" flag. This means that code backup is enabled for "folder1," and Lando database backup is also enabled. -
To skip code backup and enable Lando database backup, use:
folder1;nocode;lando
-
Backup "folder1" with code and enable Lando database backup:
-
Backup "folder2" without db(not a lando project):
folder1;skip;lando folder2;nodb
In this configuration, the "skip" flag is used to avoid applying the "nocode" flag. This means that code backup is enabled for "folder1," and Lando database backup is also enabled.