I am converting odt to pdf files on console.
Processor is at 100%.
Now, the computer goes to stand by during converting.
I am converting odt to pdf files on console.
Processor is at 100%.
Now, the computer goes to stand by during converting.
You can use one of these methods to restrict this process to some resources
How?
Using what tool?
On what condition is your machine set to go to standby?
What does “standby” mean?
sleep? suspend? hibernate?
I am using the following script:
#! /bin/bash
find /home/armin/Dokumente/Patentorganisation66pdf/ -name "*.odt" -exec ./odt2pdf.sh "{}" \;
exit
and
#! /bin/bash
libreoffice --headless --convert-to pdf --outdir $(dirname "$1") "$1"
exit
and I don´t know, if it is sleep or hibernate or suspend.
I must press the power button to go to operation.
Ich nehme mal an, daß das “find” Kommando funktioniert.
und odt2pdf.sh ruft dieses script auf:
fĂĽr jede einzelne gefundene Datei.
Ich denke ja, daĂź es bessere Methoden gibt. .odt in .pdf zu wandeln.
Man könnte ja (nur z.B.) die Dokumente, wenn man sie bearbeitet hat und dann speichert, gleich als .pdf speichern.
… vielleicht ruft das Kommando einfach (je nach dem, wie viele Dateien das sind)
zu viele Libreoffice Instanzen auf (statt nur eine zu nutzen)?
Wenn das so ist, dann wär der verfügbare Speicher wohl recht schnell erschöpft …
… keine Ahnung …
Do some of the files get converted? Can you try to isolate if it is a particular file which causes the problem?
You could maybe change the find
to start at a sub-directory of Dokumente/Patentorganisation66pdf/
(if there are any) and see if that works.
Are the files particularly large? Do you have swap space configured?
Is there any output from the ./odt2pdf.sh
to show which file is being processed, and if not maybe add an echo $1
line into the script so that there is something to indicate if it always fails at the same file.
I’ve tried running your scripts on my laptop and don’t see any problems, but my files are all quite small.
About 6500 odt files must be converted to pdf.
And this takes ~43 minutes to complete on my computer.
After ~15 minutes, the computer goes to sleep, hibernates or suspend.
All files are converted to pdf.
Are you using the laptop for other work while the conversion is running, or just leaving the laptop unattended? Is it simply that the laptop is set to sleep/hibernate/suspend after 15 minutes of no activity?
Your profile say KDE , so what are the settings in System Settings / Power Management
set to?
It is a desktop computer:
inxi -Fza:
System:
Kernel: 6.6.54-2-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 14.2.1
clocksource: tsc avail: hpet,acpi_pm
parameters: BOOT_IMAGE=/vmlinuz-6.6-x86_64
root=UUID=86b44fe2-10a4-46cd-a916-50fa4f477973 rw quiet
udev.log_priority=3
Desktop: KDE Plasma v: 6.1.5 tk: Qt v: N/A info: frameworks v: 6.6.0
wm: kwin_wayland vt: 1 dm: SDDM Distro: Manjaro base: Arch Linux
Machine:
Type: Server System: Supermicro product: X10SRA v: 0123456789
serial: <superuser required> Chassis: type: 17 v: 0123456789
serial: <superuser required>
Mobo: Supermicro model: X10SRA v: 1.01 serial: <superuser required>
uuid: <superuser required> UEFI: American Megatrends v: 2.1a
date: 10/24/2018
CPU:
Info: model: Intel Core i7-6800K bits: 64 type: MT MCP arch: Broadwell
gen: core 6 level: v3 note: check built: 2015-18 process: Intel 14nm
family: 6 model-id: 0x4F (79) stepping: 1 microcode: 0xB000040
Topology: cpus: 1x dies: 1 clusters: 6 cores: 6 threads: 12 tpc: 2
smt: enabled cache: L1: 384 KiB desc: d-6x32 KiB; i-6x32 KiB L2: 1.5 MiB
desc: 6x256 KiB L3: 15 MiB desc: 1x15 MiB
Speed (MHz): avg: 1200 min/max: 1200/3800 scaling: driver: intel_cpufreq
governor: schedutil cores: 1: 1200 2: 1200 3: 1200 4: 1200 5: 1200 6: 1200
7: 1200 8: 1200 9: 1200 10: 1200 11: 1200 12: 1200 bogomips: 81626
Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Vulnerabilities:
Type: gather_data_sampling status: Not affected
Type: itlb_multihit status: KVM: VMX disabled
Type: l1tf mitigation: PTE Inversion; VMX: conditional cache flushes, SMT
vulnerable
Type: mds mitigation: Clear CPU buffers; SMT vulnerable
Type: meltdown mitigation: PTI
Type: mmio_stale_data mitigation: Clear CPU buffers; SMT vulnerable
Type: reg_file_data_sampling status: Not affected
Type: retbleed status: Not affected
Type: spec_rstack_overflow status: Not affected
Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via
prctl
Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer
sanitization
Type: spectre_v2 mitigation: Retpolines; IBPB: conditional; IBRS_FW;
STIBP: conditional; RSB filling; PBRSB-eIBRS: Not affected; BHI: Not
affected
Type: srbds status: Not affected
Type: tsx_async_abort mitigation: Clear CPU buffers; SMT vulnerable
Graphics:
Device-1: NVIDIA TU116 [GeForce GTX 1660 Ti] driver: nouveau v: kernel
non-free: 550.xx+ status: current (as of 2024-09; EOL~2026-12-xx)
arch: Turing code: TUxxx process: TSMC 12nm FF built: 2018-2022 pcie:
gen: 1 speed: 2.5 GT/s lanes: 16 link-max: gen: 3 speed: 8 GT/s ports:
active: DP-1 empty: DVI-D-1,HDMI-A-1 bus-ID: 03:00.0 chip-ID: 10de:2182
class-ID: 0300 temp: 26.0 C
Display: wayland server: X.org v: 1.21.1.13 with: Xwayland v: 24.1.2
compositor: kwin_wayland driver: X: loaded: modesetting
alternate: fbdev,vesa dri: nouveau gpu: nouveau display-ID: 0
Monitor-1: DP-1 res: 2560x1440 size: N/A modes: N/A
API: EGL v: 1.5 hw: drv: nvidia nouveau platforms: device: 0 drv: nouveau
device: 1 drv: swrast gbm: drv: nouveau surfaceless: drv: nouveau wayland:
drv: nouveau x11: drv: nouveau
API: OpenGL v: 4.5 compat-v: 4.3 vendor: mesa v: 24.2.4-arch1.0.1
glx-v: 1.4 direct-render: yes renderer: NV168 device-ID: 10de:2182
memory: 5.84 GiB unified: no display-ID: :1.0
API: Vulkan Message: No Vulkan data available.
Audio:
Device-1: Intel C610/X99 series HD Audio vendor: Super Micro
driver: snd_hda_intel v: kernel bus-ID: 00:1b.0 chip-ID: 8086:8d20
class-ID: 0403
Device-2: NVIDIA TU116 High Definition Audio driver: snd_hda_intel
v: kernel pcie: gen: 1 speed: 2.5 GT/s lanes: 16 link-max: gen: 3
speed: 8 GT/s bus-ID: 03:00.1 chip-ID: 10de:1aeb class-ID: 0403
API: ALSA v: k6.6.54-2-MANJARO status: kernel-api with: aoss
type: oss-emulator tools: alsactl,alsamixer,amixer
Server-1: JACK v: 1.9.22 status: off tools: N/A
Server-2: PipeWire v: 1.2.5 status: active with: 1: pipewire-pulse
status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin
tools: pactl,pw-cat,pw-cli,wpctl
Network:
Device-1: Intel I210 Gigabit Network vendor: Super Micro driver: igb
v: kernel pcie: gen: 1 speed: 2.5 GT/s lanes: 1 port: d000 bus-ID: 05:00.0
chip-ID: 8086:1533 class-ID: 0200
IF: eno1 state: down mac: <filter>
Device-2: Intel I210 Gigabit Network vendor: Super Micro driver: igb
v: kernel pcie: gen: 1 speed: 2.5 GT/s lanes: 1 port: c000 bus-ID: 06:00.0
chip-ID: 8086:1533 class-ID: 0200
IF: eno2 state: up speed: 1000 Mbps duplex: full mac: <filter>
Info: services: NetworkManager
Drives:
Local Storage: total: 1.36 TiB used: 307.09 GiB (22.0%)
SMART Message: Unable to run smartctl. Root privileges required.
ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Samsung model: SSD 980 PRO 1TB
size: 931.51 GiB block-size: physical: 512 B logical: 512 B speed: 63.2 Gb/s
lanes: 4 tech: SSD serial: <filter> fw-rev: 5B2QGXA7 temp: 23.9 C
scheme: GPT
ID-2: /dev/sda maj-min: 8:0 vendor: Samsung model: SSD 860 EVO 250GB
size: 232.89 GiB block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s
tech: SSD serial: <filter> fw-rev: 4B6Q scheme: GPT
ID-3: /dev/sdb maj-min: 8:16 vendor: Samsung model: SSD 850 EVO 250GB
size: 232.89 GiB block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s
tech: SSD serial: <filter> fw-rev: 2B6Q scheme: GPT
Partition:
ID-1: / raw-size: 100 GiB size: 97.87 GiB (97.87%) used: 8.85 GiB (9.0%)
fs: ext4 dev: /dev/nvme0n1p8 maj-min: 259:8
ID-2: /boot raw-size: 1024 MiB size: 973.4 MiB (95.06%)
used: 222.1 MiB (22.8%) fs: ext4 dev: /dev/nvme0n1p6 maj-min: 259:6
ID-3: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%)
used: 300 KiB (0.1%) fs: vfat dev: /dev/nvme0n1p5 maj-min: 259:5
ID-4: /home raw-size: 300 GiB size: 294.23 GiB (98.08%)
used: 16.63 GiB (5.7%) fs: ext4 dev: /dev/nvme0n1p9 maj-min: 259:9
ID-5: /var raw-size: 32.46 GiB size: 31.66 GiB (97.51%)
used: 11.18 GiB (35.3%) fs: ext4 dev: /dev/nvme0n1p10 maj-min: 259:10
Swap:
Kernel: swappiness: 60 (default) cache-pressure: 100 (default) zswap: yes
compressor: zstd max-pool: 20%
ID-1: swap-1 type: partition size: 32 GiB used: 0 KiB (0.0%) priority: -2
dev: /dev/nvme0n1p7 maj-min: 259:7
Sensors:
System Temperatures: cpu: 18.0 C pch: 29.5 C mobo: N/A gpu: nouveau
temp: 26.0 C
Fan Speeds (rpm): N/A gpu: nouveau fan: 418
Info:
Memory: total: 32 GiB available: 31.22 GiB used: 2.22 GiB (7.1%)
Processes: 327 Power: uptime: 2m states: freeze,mem,disk suspend: deep
avail: s2idle wakeups: 0 hibernate: platform avail: shutdown, reboot,
suspend, test_resume image: 12.48 GiB services: org_kde_powerdevil,
power-profiles-daemon, upowerd Init: systemd v: 256 default: graphical
tool: systemctl
Packages: pm: pacman pkgs: 1287 libs: 364 tools: pamac pm: flatpak pkgs: 0
Compilers: N/A Shell: Zsh v: 5.9 default: Bash v: 5.2.37 running-in: konsole
inxi: 3.3.36
The settings in power managment “schlafen” is set to 15 minutes.
Then there is no issue - the conversion task was already done and finished,
which is why your machine then went to sleep after the set amount of 15 minutes.
Alles gut also:
das Script war fertig, alle Dokumente konvertiert.
Er hat also getan, was er sollte:
schlafen gehen nach 15 Minuten.
Do you have Latex installed; possibly in the form of texlive
…
If so, then an alternative solution for converting odt to *pdf is using pandoc
. This could be scripted as needed, but Latex is required for .pdf
output:
1. Install pandoc:
sudo pacman -S pandoc
2. Convert .odt
to .pdf
(example):
pandoc -s HelloWorld.odt -o HelloWorld.pdf
pandoc -s "Hello World.odt" -o "Hello World.pdf"
Another option exists which I will post when I find the link.
Edit:- I couldn’t find that one; however…
If you install cups
from the official repo, cups-pdf
should also be installed. This would allow you to print an .odt
file directly to PDF
. General cups
information here:
Perhaps this is a viable alternative.
Once installed, it should allow a selectable Print to file (PDF) option to appear in most Print dialogs; at least on mine, using KDE Plasma 6.
If for some reason it’s not installed with cups
, install directly:
sudo pacman -S cups-pdf
Cheers.
Does anyone has experience with these converters ?
Which works faster than the libreoffice pdf converter and uses less RAM.
During operation, the libreoffice converter uses 32 GB RAM and for 6550 odt files, my computer needs 45 minutes to complete.
With such a high volume of files to convert, 45 minutes seems about average, to me. No matter which method you use it’s going to take time; I don’t think this can be avoided.
Well, you could change your power saving settings; set suspend to 1 hour, or similar. My guess is that you don’t want to do that; so here’s another option;
Caffeine-ng will prevent screen blanking, sleep, or hibernation, for as long as you have it active:
pamac build caffeine-ng
Cheers.
Plasma has this type of feature built-in. It can be accessed via the System Tray => Power Management => Sleep and Screen Locking after Inactivity => Manually Block:
I probably have a comprehension problem or the circumstance is not communicated properly.
And I have said this already.
The above to me means:
the job took under 15 minutes
and
is already done.
After 15 minutes the computer goes to sleep.
Then I have to turn on again and then the converting is completed after 45 minutes.
I can´t find the dialogue Sleep and Screen Locking after Inactitivty
Manually block.
It may just look different for you.
Screen Lock is under System Settings → Security and Privacy
Power Management is under System Settings → System (for example what happens after a period of inactivity)
I did assume you use Plasma.
Its in the drop-down menu from the power widget. Click on the battery icon.
Since you have a desktop and I have a laptop I’m not sure where the settings would be, but you should be able to find somewhere in System Settings
where it mentions 15 minutes and change it.
The libreoffice
process seems to take a significant amount of time to get started, so each time it starts it slows down the overall time. It does not appear possible to run it several times in parallel as they interfere with each other (a shared profile area I think), but it does (for me) appear quicker to process a whole directory at once.
Since the --outdir
can only specified once you can’t span multiple directories, but I tried something like this
#! /bin/bash
find /home/armin/Dokumente/Patentorganisation66pdf/ -type d -exec ./odt2pdf.sh "{}" \;
exit
#! /bin/bash
if (( `ls "$1" | grep -c 'odt$'` > 0 )) ; then
libreoffice --headless --convert-to pdf --outdir "$1" "$1"/*odt
fi
exit