I am trying to upload my Heroku backups to a folder.
Download to the current folder, how it works:
curl -o latest.dump `heroku pg:backups public-url`
But when I tried to add the path foldersto latest.dump, it looks like this:
$ curl -o /db-bkups/latest.dump `heroku pg:backups public-url`
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 44318 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0Warning: Failed to create the file
Warning: /db-bkups/latest.dump: No such file
Warning: or directory
36 44318 36 16384 0 0 9626 0 0:00:04 0:00:01 0:00:03 9626
curl: (23) Failed writing body (0 != 16384)
Ideally, I would like it to be saved and loaded as follows:
/db-bkups/nov-1-2016/timestamp-db.dump
If the folder nov-1-2016is created dynamically when cron starts, and the file name is the timestamp when bkup starts.
source
share