Skip to content

Commit 5f5218d

Browse files
committed
feat: userdata 스크립트 다운로드 및 cron 작업 등록
1 parent d853930 commit 5f5218d

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

terraform/dev/scripts/user-data.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
echo ECS_CLUSTER=${ecs_cluster_name} >> /etc/ecs/ecs.config
3+
4+
fallocate -l 2G /swapfile
5+
chmod 600 /swapfile
6+
mkswap /swapfile
7+
swapon /swapfile
8+
echo '/swapfile none swap sw 0 0' >> /etc/fstab
9+
10+
/bin/mkdir -p /home/ec2-user/logs/eatda
11+
12+
aws s3 cp s3://eatda-storage-dev/scripts/app-backup-dev-logs.sh /home/ec2-user/logs/eatda/app-backup-dev-logs.sh
13+
chmod +x /home/ec2-user/logs/eatda/app-backup-dev-logs.sh
14+
15+
(crontab -l 2>/dev/null; echo "0 0 * * 0 /home/ec2-user/logs/eatda/app-backup-dev-logs.sh >> /var/log/app-backup.log 2>&1") | crontab -

0 commit comments

Comments
 (0)