brunoteixeira1996 / gbackup Goto Github PK
View Code? Open in Web Editor NEWScript in Golang to backup and export info to Prometheus
Script in Golang to backup and export info to Prometheus
For some reason the backup for storagepool is not working
Its ok to use cronjob from Linux, however I rather use everything in Go instead.
Knowing this, I should implement something like this from gmah
runCh := make(chan struct{})
go func() {
// Run forever, trigger a run at 18:00 every day.
for {
now := time.Now()
runToday := now.Hour() < 18
today := now.Day()
log.Printf("now = %v, runToday = %v", now, runToday)
for {
if time.Now().Day() != today {
// Day changed, re-evaluate whether to run today.
break
}
nextHour := time.Now().Truncate(time.Hour).Add(1 * time.Hour)
log.Printf("today = %d, runToday = %v, next hour: %v", today, runToday, nextHour)
time.Sleep(time.Until(nextHour))
if time.Now().Hour() >= 18 && runToday {
runToday = false
runCh <- struct{}{}
}
}
}
}()
for range runCh {
run(args.Email, args.Password, args.Dump, &newMessages, args.Gokrazy)
}
Add size diff in order to view if target is bigger or smaller
Looks like there are tars older than 15 days still available in storagepool
and external
hard drive
Add time duration
I dont need to have a cronjob inside gk LXC. I can have a similar setup like Syncthing.
I need to create a ssh key file in proxmox, then add that to the authozired_keys inside gk lxc and then make sure I can rsync from gk lxc to proxmox.
This way I will have information in grafana.
I should do the same for the leaks.
Right now I am performing incremental backups with rsync but I want to have similar information not incremental.
Need to change some flags on rsync
I've noticed there are some typos and stuff I dont use anymore
Update README with the new setup
I should use rsync to copy from /mnt/pve/external
to /storagepool/backups
since that will be faster and rsync will only make diffs
Create a route that when a POST is made perform the backup on demand
Add gmah backup into gokrazy perm
Create simple webserver that waits for a POST request to execute a backup on demand.
This webserver has a GET request to list the available backup targets meaning that the POST requests expects a JSON object of targets or in case of all a *
Later this can be used in the telegram bot
After using cronjob from golang email template is empty without Content
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.