AWS: Add a timestamp to user-data.log
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 5 Dec 2018 14:42:54 +0000 (14:42 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 5 Dec 2018 14:42:54 +0000 (14:42 +0000)
This way, multiple (failed) runs of the script won't
overwrite the log file.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/initscripts/helper/aws-setup

index d79d1c6..af6d24c 100644 (file)
@@ -107,7 +107,8 @@ import_aws_configuration() {
                        chmod 700 /tmp/aws-user-data.script
 
                        # Run the user-data script
-                       /tmp/aws-user-data.script &>/var/log/user-data.log
+                       local now="$(date -u +"%s")"
+                       /tmp/aws-user-data.script &>/var/log/user-data.log.${now}
 
                        # Delete the script right away
                        rm /tmp/aws-user-data.script