tiro-notes 0.40.74 → 0.40.76

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/cli.js +6 -4
  2. package/package.json +1 -1
package/cli.js CHANGED
@@ -28,7 +28,7 @@ ARGS:
28
28
 
29
29
  --tunnel/-t : [require autossh] uses autossh to "publish" the app on the web, requires a server you can access with ssh and autossh installed on that device. (ex:npx tiro-notes@latest -t REMOTE_USER@REMOTE_URL:REMOTE_PORT)
30
30
 
31
- --backup/-b : [require tar] will incrementally backup changes in archives like tiro.0.xz.tar, tiro.1.xz.tar... every day in a specific folder. You can then execute commands after that process in a post backup script (useful for syncing these archives to clouds, think rsync, rclone etc.)
31
+ --backup/-b : [t/n/now/force/f] [require tar] will incrementally backup changes in archives like tiro.0.xz.tar, tiro.1.xz.tar... every day in a specific folder. You can then execute commands after that process in a post backup script (useful for syncing these archives to clouds, think rsync, rclone etc.)
32
32
  --backup-folder : modify backup folder destination. (default: "your/path/to/tiro/data_folder"+_backup
33
33
  --backup-post-script : modify script to be executed after a backup finishes. Should be a ".txt" file with your OS commands. (default: "your/path/to/tiro/data_folder"+_backup/post_backup_script.txt
34
34
 
@@ -81,7 +81,7 @@ function getCliArgs () {
81
81
  if (argName === 'v' || argName === 'verbose') argsObj.verbose = parseInt(argVal)
82
82
 
83
83
  if (argName === 'b' || argName === 'backup') argsObj.backup.enabled = true
84
- if (argName === 'b' || argName === 'backup') argsObj.backup.now = (argVal === "now" || argVal === "n") ? true : false
84
+ if (argName === 'b' || argName === 'backup') argsObj.backup.now = (argVal === "now" || argVal === "n" || argVal === "force" || argVal === "f") ? true : false
85
85
  if (argName === 'backup-location') argsObj.backup.location = argVal
86
86
  if (argName === 'backup-post-script') argsObj.backup.scriptLocation = argVal
87
87
 
@@ -153,7 +153,8 @@ const startBackupScript = async (argsObj, dataFolder) => {
153
153
  let replaceTimestampCli = () => `echo ${now()} > '${timestampFile}'`
154
154
 
155
155
  // START INTERVAL
156
- const timeInterval = 1000 * 60 * 60 // one hour
156
+ // const timeInterval = 1000 * 60 * 60 // one hour
157
+ const timeInterval = 1000 * 60 * 10 // one hour
157
158
  const backupInterval = 1000 * 60 * 60 * 24 // one day
158
159
 
159
160
  const tarExec = process.platform === "darwin" ? "gtar" : "tar"
@@ -188,7 +189,8 @@ const startBackupScript = async (argsObj, dataFolder) => {
188
189
 
189
190
  console.log (debugObj);
190
191
  } else {
191
- console.log(`[BACKUP] time has no come... still waiting for ${diffMin} mins AND waiting for being between 1am-5am`);
192
+ const logTime = new Date().toLocaleString()
193
+ console.log(`[BACKUP] ${logTime} => not yet. Waiting for ${diffMin} mins < 0 AND between 1am-5am ${JSON.stringify({isBetween1am5am, currHour: new Date().getHours()})}}`);
192
194
  }
193
195
  }
194
196
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tiro-notes",
3
- "version": "0.40.74",
3
+ "version": "0.40.76",
4
4
  "description": "Tiro Notes CLI to start Tiro Notes from the command line!",
5
5
  "scripts": {
6
6
  "dev": "ISDEV=true node cli.js",