# Created by muslu at 28.09 . 2021 14 : 46 mkdir /mnt/ ramfs_postgres mkdir /mnt/ ramfs_postgres_bck mount -t tmpfs -o rw, size = 20 G tmpfs /mnt/ ramfs_postgres echo "tmpfs /mnt/ramfs_postgres tmpfs rw,size=20G 0 0" >> /etc/ fstab cat <<EOT > /lib/ systemd /system/ ramfs_postgres.service [Unit] Before=umount.target [Service] Type=oneshot User=root ExecStartPre= /bin/ chown -Rf root /mnt/ ramfs_postgres / ExecStart=/u sr /bin/ rsync -ar /mnt/ ramfs_postgres_bck / /m nt /ramfs_postgres/ ExecStop= /usr/ bin /rsync -ar /m nt /ramfs_postgres/ /mnt/ ramfs_postgres_bck / ExecStopPost=/ bin /chown -Rf root /m nt /ramfs_postgres_bck/ RemainAfterExit=yes [Install] WantedBy=multi-user.target EOT systemctl enable ramfs_postgres systemctl restart ramfs_postgres systemctl status ramfs_postgres #ls /mnt/ ramfs_postgres{,_bck} ######################### #systemctl disable ramfs_postgres #rm /lib/ systemd /system/ ramfs_postgres.service #systemctl daemon-reload #umount /mn...