Job Types
- [x] Only Backup
- [x] Backup & Upload
- [x] Exec & Upload
Functionalities to add
# For showing multiplethings about jobs
$ xd show [all/active/inactive]
# To Stop a job from being executed periodically
$ xd disable <job>
# To Enable a disabled Job
$ xd enable <job>
# In-case a job needs to be updated to the latest changes in the template
$ xd update <job>
New Job Example
name: Example-Backup-n-upload
schedule: 0 0 * * *
execute:
backup:
- basedir: /home/foo/some_server_dir
resources:
- resource1
- resource2
- resource3
export: <u>**/home/bar/some-name-{timestamp}.zip**</u>
upload: True # by-default: False
- basedir: /home/bar
resources:
- resource1
- resource2
- resource3
export: <u>**/home/bar/some-other-name-{timestamp}.zip**</u>
run:
- exec: psql mydb > /foo/bar/mydb_dump-{timestamp}.sql
upload_path: /foo/bar/mydb_dump-{timestamp}.sql
creds:
API-KEY: jgauduygudg87216
USERNAME: alpha
PASSWORD: beta
Abstraction
# Abstraction
class IStorage(ABC):
# upload
# check_if_exists
# ...
class AWSStorage(IStorage):
# set_creds(creds)
# upload(path)
class AzureStorage(IStorage):
# Implements Azure Functionalities
def upload_file(job, ds: IStorage):
# USES Storage
New JSON DataStore Structure
{
jobs: {
1: {
'file': '/foo/bar.txt',
'name': 'job-name',
'user': root
}
}
names: {
'job-name': 1,
},
active: [1, 2, 3]
}
ADD
- [x] Logging → Commit
- [x] CommandLine Updates
- [x] Datastore Structure Change → Adapt to new structure
- [x] Upload → AWS Testing | Storage implementation