UNPKG
@oleksiiteplenko/tt
Version:
latest (0.8.0)
0.8.0
0.7.0
0.6.0
0.5.0
0.4.0
0.3.0
0.2.0
0.1.1
0.1.0
CLI tool for tracking time on projects.
oleksiiteplenko/tt
@oleksiiteplenko/tt
/
src
/
scripts
/
backupDB.ts
10 lines
(6 loc)
•
278 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
10
import
{ join }
from
"path"
;
const
timestamp =
Date
.
now
();
const
{ dir } =
import
.
meta
;
const
file =
Bun
.
file
(
join
(dir,
"../../db/sqlite/tt.db"
));
await
Bun
.
write
(
join
(dir,
`../../db/backups/
${timestamp}
.tt.db`
), file);
console
.
log
(
'Backup complete: '
,
new
Date
(timestamp));