Fix "invalid cross-device link" error when running on a different filesystem (#1769)
* fix cross-device rename errors * fallback to copy instead of always using it * use tmp dir in data folder * recreate tmp dir at startup
This commit is contained in:
11
main.go
11
main.go
@@ -47,6 +47,17 @@ func main() {
|
||||
}
|
||||
}
|
||||
|
||||
// Recreate the temp dir
|
||||
if utils.DoesFileExists(config.TempDir) {
|
||||
err := os.RemoveAll(config.TempDir)
|
||||
if err != nil {
|
||||
log.Fatalln("Unable to remove temp dir!")
|
||||
}
|
||||
}
|
||||
if err := os.Mkdir(config.TempDir, 0700); err != nil {
|
||||
log.Fatalln("Unable to create temp dir!", err)
|
||||
}
|
||||
|
||||
configureLogging(*enableDebugOptions, *enableVerboseLogging)
|
||||
log.Infoln(config.GetReleaseString())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user