Table of Contents
Linux
Backup directory
rsync -vr /home/user/important_directory /media/some_hdd/backups/
Hint: With a / at the end of the first directory, all sub directories are copied directly to the destination folder. Without / it will create the source folder (ex. important_directory) with all sub directories are copied to the destination folder
Forward Mails of A User
You have a server for example and some mails are sent directly to root. The easiest way to forward them to a real address ist to create a .forward file.
/root/.forward
user@example.org
Immportant: The last line of the file have to be empty. It won't work without newline.
Misconfiguration may result in following log lines of your mail server:
Jul 6 10:10:48 myHostName postfix/cleanup[362]: 4E14342D46: message-id=<20140706081048.4E14342D46@mail.example.org> Jul 6 10:10:48 myHostName postfix/qmgr[24720]: 4E14342D46: from=<>, size=2540, nrcpt=1 (queue active) Jul 6 10:10:48 myHostName postfix/bounce[368]: 3D46942C3D: sender non-delivery notification: 4E14342D46 Jul 6 10:10:48 myHostName postfix/smtp[367]: 4E14342D46: to=<root@mail.example.org>, relay=none, delay=0.04, delays=0.01/0/0.03/0, dsn=5.4.6, status=bounced (mail for mail.example.org loops back to myself) Jul 6 10:10:48 myHostName postfix/qmgr[24720]: 4E14342D46: removed
Validate XML Against Template
xmllint --schema schema.xsd --noout file.xml
or
xmlstarlet val -s schema.xsd -e file.xml
fstrim
On major Linux distributions (Debian, Rocky, …), there is a sytemd timer for fstrim prepared but not activated per default. If you are using SSDs or virtual machines and your filesystem supports it, you can enable the timer to discard unused blocks once per week.
Check if the timer is already enabled. If 0 timers are listed, it means it's not activated.
systemctl list-timers fstrim.timer
Enable and immediately start the timer.
systemctl enable --now fstrim.timer
- Example
[root@server ~]# systemctl list-timers fstrim.timer NEXT LEFT LAST PASSED UNIT ACTIVATES 0 timers listed. Pass --all to see loaded but inactive timers, too. [root@server ~]# systemctl enable --now fstrim.timer Created symlink /etc/systemd/system/timers.target.wants/fstrim.timer → /usr/lib/systemd/system/fstrim.timer. [root@server ~]# systemctl list-timers fstrim.timer NEXT LEFT LAST PASSED UNIT ACTIVATES Mon 2024-07-01 01:28:50 CEST 4 days left - - fstrim.timer fstrim.service 1 timers listed. Pass --all to see loaded but inactive timers, too.
Ubuntu Desktop to Ubuntu Server
apt-get purge libx11.* libqt.* apt-get autoremove
Source: askubuntu.com