- Newest
- Most votes
- Most comments
I used Touch to create files from days to years old, and after one day the /TMP directory was unchanged. I also did a quick check of the cron files and didn't see anything related to /TMP. Therefore, /TMP files likely stick around until the instance reboots. This means that you could use up all your instance's disk space unless you are careful, and never have a process crash. This seems to be a dangerous design.
touch -d "2020-01-28 12:12:12.000000000 +0530" test01.txt
I created my own temp directory at /mnt/tmp, and a cron that runs every hour to remove files over an hour old. This will be my safety net in case something unexpected happens.
.ebextensions > 01_setup.config
{
"commands": {
"01_create_tmp_folder": {
"command": "mkdir -p /mnt/tmp"
},
"02_set_tmp_folder_permission": {
"command": "chmod 777 /mnt/tmp"
}
"files": {
"/etc/cron.hourly/GC": {
"group": "root",
"owner": "root",
"mode": "000777",
"content": "#!/bin/bash -e\ncd /mnt/tmp\nfind . -mmin +70 -delete\nexit 0\n"
}
}
Within /mnt/tmp, running "df -h ." confirmed that I had access to the increased instance store space.
Also, it turns out that only very large instances have a small SSD instance store included, default instance stores in the standard case is EBS Only.
Peter
Relevant content
- asked a year ago
- asked 10 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 4 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago