mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 17:46:28 +08:00
core: update backup filename format
This commit is contained in:
1 parent
7218390c3b
commit
c28f2b3437
2 files changed
+2
-2
No files matched your search
@@ -130,7 +130,7 @@ if (argv.args[0] === 'backup') {
|
|||||||
exec('mongodump', [url, `--out=${dir}/dump`], { stdio: 'inherit' });
|
exec('mongodump', [url, `--out=${dir}/dump`], { stdio: 'inherit' });
|
||||||
const env = `${os.homedir()}/.hydro/env`;
|
const env = `${os.homedir()}/.hydro/env`;
|
||||||
if (fs.existsSync(env)) fs.copySync(env, `${dir}/env`);
|
if (fs.existsSync(env)) fs.copySync(env, `${dir}/env`);
|
||||||
const target = `${process.cwd()}/backup-${new Date().toISOString()}.zip`;
|
const target = `${process.cwd()}/backup-${new Date().toISOString().replace(':', '-').split(':')[0]}.zip`;
|
||||||
exec('zip', ['-r', target, 'dump'], { cwd: dir, stdio: 'inherit' });
|
exec('zip', ['-r', target, 'dump'], { cwd: dir, stdio: 'inherit' });
|
||||||
if (!argv.options.dbOnly) {
|
if (!argv.options.dbOnly) {
|
||||||
exec('zip', ['-r', target, 'file'], { cwd: '/data', stdio: 'inherit' });
|
exec('zip', ['-r', target, 'file'], { cwd: '/data', stdio: 'inherit' });
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hydrooj",
|
"name": "hydrooj",
|
||||||
"version": "3.9.4",
|
"version": "3.9.5",
|
||||||
"bin": "bin/hydrooj.js",
|
"bin": "bin/hydrooj.js",
|
||||||
"main": "src/loader",
|
"main": "src/loader",
|
||||||
"module": "src/loader",
|
"module": "src/loader",
|
||||||
|
|||||||
Reference in new issue
Block a user