Created
September 17, 2016 16:31
-
-
Save alxlion/046833ef5f38238354cd77f0e7d8bf33 to your computer and use it in GitHub Desktop.
Auto create swap DigitalOcean
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo fallocate -l 1G /swapfile; | |
chmod 600 /swapfile; | |
mkswap /swapfile; | |
swapon /swapfile; | |
echo "/swapfile none swap sw 0 0" >> /etc/fstab; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment