Cloud storages :
Use with rclone
(evolutive article where I store what's been useful to me to clean space on linux servers I'm using)
Note : my current servers are running Ubuntu.
Only keep 10M of each log files handle through syslog
sudo journalctl --vacuum-size 10M
Remove automatically all unused packages Remove automatically installed packages not needed anymore (i.e. packages that were installed as dependencies of packages that have now been removed or aren't requiring this dependency anymore)
apt options :
sudo apt-get clean autoremove autoclean
Only keep the last 1000h of docker containers logs
sudo docker image prune --all --filter "until=1000h" -f
Remove unused volumes, containers, images, networks, etc.
sudo docker system prune -f
sudo docker system prune -a --volumes
fixing /Users defined partition after an upgrade of mac os X.
The Mac I was using was configured before I got it, and I needed to upgrade it to use some more recent applications, but I ran into some issues due to a specific configuration of the /Users partition being located on a different partition than the OS data.
I could not mount it properly, due to 2 errors (might have been possible to mount it directly in HFS, but I also fixed it during the debug, just publishing my fix here with both steps).
Error :
sudo mount -uw /Users
Password:
mount_apfs: volume could not be mounted: Operation not permitted
mount: /Users failed with 77
with Disk Utility tool > menu "Edit" > "Convert to APFS"...
/etc/fstab, edited with (sudo) vifs
was :
UUID=12QW345E-1234-5678-123QWE123QWE /Users hfs auto
changed to :
UUID=12QW345E-1234-5678-123QWE123QWE /Users apfs rw 1 2
Boot in recovery mode ( mac + R )
Launch (menu Utilities) > Terminal
an old post found back on disqr about rsync (original date : circa 2016)
You might want to use the rsync exclude options directly in your script either by specifying a file with all the exclusions to perform, or by specifying them in the command line directly :
--exclude-from <file-name with 1 pattern by line>
--exclude <file or="" dir="">
For example :
One important thing to keep in mind when excluding a directory is that rsync will always consider the path to be relative to the source directory.
This can be used for example when you want to push your production from a Production JIRA instance to a Staging JIRA instance, but your dbconfig.xml is different (different DB auth parameters for example), and hence want to avoid some files.
# vnconfig vnd0 image.iso
# mount -t cd9660 /dev/vnd0a /mnt
# umount /mnt
# vnconfig -u vnd0
command="COMMAND" TYPE KEY COMMENTEn utilisant cette syntaxe, pour restreindre l'accès uniquement au service svn, on peut également ajouter "no-port-forwarding" ainsi que "no-agent-forwarding,no-X11-forwarding,no-pty"
command="svnserve -t",no-port-forwarding TYPE KEY COMMENT
svn co svn+ssh://svn@host/path/to/base/repos
command="svnserve -r /path/to/base/",no-port-forwarding TYPE KEY COMMENT
command="/path/to/svnserve -t -r /repository/root --tunnel-user=alice",no-port-forwarding,no-agent-forwarding,no-X11-forwarding,no-pty TYPE1 KEY1 COMMENT1
command="/path/to/svnserve -t -r /repository/root --tunnel-user=bob",no-port-forwarding,no-agent-forwarding,no-X11-forwarding,no-pty TYPE2 KEY2 COMMENT2
sudo fdisk /dev/sdb1
sudo mkfs.ext3 /dev/sdb1
sudo e2label /dev/sdb1 {{snip label}}
# vol_id /dev/sdb1
ID_FS_USAGE=filesystem
ID_FS_TYPE=ext3
ID_FS_VERSION=1.0
ID_FS_UUID={{snip}}
ID_FS_UUID_ENC={{snip}}
ID_FS_LABEL={{snip label}}
ID_FS_LABEL_ENC={{snip}}
ID_FS_LABEL_SAFE={{snip}}
LABEL={{snip label}} /media/{{snip mount point}} ext3 user,auto 0 0
VOL_ID(8) vol_id VOL_ID(8)
NAME
vol_id - probe filesystem type and read label and uuid
SYNOPSIS
vol_id [--export] [--type] [--label] [--label-raw] [--uuid]
[--skip-raid] [--probe-all] [--help] [device]
DESCRIPTION
vol_id is usually called from a udev rule, to provide udev with the
filesystem type, the label and the uuid of a volume. It supports most
of the common filesystem formats and detects various raid setups to
prevent the recognition of raid members as a volume with a filesystem.